mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-05-03 12:37:50 +08:00
Update media-library.js
Adjusted for default dimention based on window width (css media query) fixed class lookup as .thumbnail has 0 height on load.
This commit is contained in:
parent
63ca6ee2d8
commit
99695f07cc
@ -71,10 +71,11 @@ $(function () {
|
||||
|
||||
var listWidth = $('#media-library-main-list').width();
|
||||
var listHeight = $('#media-library-main-list').height();
|
||||
var itemWidth = $('.thumbnail').first().width();
|
||||
var itemHeight = $('.thumbnail').first().height();
|
||||
if (itemHeight == 0) itemHeight = 200;
|
||||
if (itemWidth == 0) itemWidth = 200;
|
||||
var itemWidth = $('#media-library-main-list li').first().width();
|
||||
var itemHeight = $('#media-library-main-list li').first().height();
|
||||
var defaultDimension = $(window).width() < 1420 ? 120 : 200;
|
||||
if (itemHeight == 0 || itemHeight == null) itemHeight = defaultDimension;
|
||||
if (itemWidth == 0 || itemHeight == null) itemWidth = defaultDimension;
|
||||
var draftText = $("#media-library").data("draft-text");
|
||||
|
||||
var itemsPerRow = Math.floor(listWidth / itemWidth);
|
||||
|
Loading…
Reference in New Issue
Block a user