diff --git a/modules/cms/widgets/mediamanager/assets/js/mediamanager.js b/modules/cms/widgets/mediamanager/assets/js/mediamanager.js index 00de9d83c..5c19242de 100644 --- a/modules/cms/widgets/mediamanager/assets/js/mediamanager.js +++ b/modules/cms/widgets/mediamanager/assets/js/mediamanager.js @@ -199,7 +199,7 @@ } MediaManager.prototype.isSearchMode = function() { - return this.$el.find('[data-type="search-mode"]').val() == 'true' + return this.$el.find('[data-type="search-mode"]').val() == 'true' } MediaManager.prototype.initScroll = function() { @@ -264,7 +264,7 @@ if (this.isPreviewSidebarVisible()) { // Use the timeout to prevent too many AJAX requests // when the selection changes too quickly (with the keyboard arrows) - this.selectTimer = setTimeout(this.proxy(this.updateSidebarPreview), 100) + this.selectTimer = setTimeout(this.proxy(this.updateSidebarPreview), 100) } // Disable delete and move buttons @@ -407,7 +407,7 @@ this.resetSearch() this.gotoFolder($item.data('path'), true) } - } + } else if ($item.data('item-type') == 'file') { // Trigger the Insert popup command if a file item // was double clicked or Enter key was pressed. @@ -432,7 +432,7 @@ $sidebar.removeClass('hide') this.updateSidebarPreview() $button.removeClass('sidebar-hidden') - } + } else { $sidebar.addClass('hide') $button.addClass('sidebar-hidden') @@ -597,8 +597,8 @@ for (var i = (placeholders.length-1); i >= 0; i--) this.thumbnailQueue.push({ id: placeholders[i].getAttribute('id'), - width: placeholders[i].getAttribute('data-width'), - height: placeholders[i].getAttribute('data-height'), + width: placeholders[i].getAttribute('data-width'), + height: placeholders[i].getAttribute('data-height'), path: placeholders[i].getAttribute('data-path'), lastModified: placeholders[i].getAttribute('data-last-modified') }) @@ -919,6 +919,10 @@ paths = [] for (var i=0, len=items.length; i 2 || Math.abs(deltaY) > 2)) { - // Start processing the selection only if the mouse was moved by + // Start processing the selection only if the mouse was moved by // at least 2 pixels. this.createSelectionMarker() @@ -1209,20 +1213,20 @@ if (this.selectionStarted) { if (deltaX >= 0) { - this.selectionMarker.style.left = this.selectionStartPoint.x + 'px' - this.selectionMarker.style.width = deltaX + 'px' + this.selectionMarker.style.left = this.selectionStartPoint.x + 'px' + this.selectionMarker.style.width = deltaX + 'px' } else { - this.selectionMarker.style.left = relativePosition.x + 'px' - this.selectionMarker.style.width = Math.abs(deltaX) + 'px' + this.selectionMarker.style.left = relativePosition.x + 'px' + this.selectionMarker.style.width = Math.abs(deltaX) + 'px' } if (deltaY >= 0) { - this.selectionMarker.style.height = deltaY + 'px' + this.selectionMarker.style.height = deltaY + 'px' this.selectionMarker.style.top = this.selectionStartPoint.y + 'px' } else { - this.selectionMarker.style.top = relativePosition.y + 'px' + this.selectionMarker.style.top = relativePosition.y + 'px' this.selectionMarker.style.height = Math.abs(deltaY) + 'px' } } @@ -1285,7 +1289,7 @@ var old = $.fn.mediaManager $.fn.mediaManager = function (option) { - var args = Array.prototype.slice.call(arguments, 1), + var args = Array.prototype.slice.call(arguments, 1), result = undefined this.each(function () { @@ -1296,7 +1300,7 @@ if (typeof option == 'string') result = data[option].apply(data, args) if (typeof result != 'undefined') return false }) - + return result ? result : this } @@ -1317,4 +1321,4 @@ $('div[data-control=media-manager]').mediaManager() }) -}(window.jQuery); \ No newline at end of file +}(window.jQuery);