Skip to content

Commit

Permalink
[cmd:quicklook] fix #2191 add an option `commandsOptions.quicklook.co…
Browse files Browse the repository at this point in the history
…ntain`
  • Loading branch information
nao-pon committed Sep 5, 2017
1 parent 8d80086 commit 165336f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 7 additions & 6 deletions js/commands/quicklook.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,17 @@
* @return void
**/
openedCss = function() {
var win = $(window);
var elf = fm.getUI().offset();
var w = Math.min(width, $(window).width()-10);
var h = Math.min(height, $(window).height()-80);
var contain = self.options.contain,
win = contain? fm.getUI() : $(window),
elf = fm.getUI().offset(),
w = Math.min(width, win.width()-10),
h = Math.min(height, win.height()-80);
return {
opacity : 1,
width : w,
height : h,
top : parseInt((win.height() - h - 60) / 2 + win.scrollTop() - elf.top),
left : parseInt((win.width() - w) / 2 + win.scrollLeft() - elf.left)
top : parseInt((win.height() - h - 60) / 2 + (contain? 0 : win.scrollTop() - elf.top)),
left : parseInt((win.width() - w) / 2 + (contain? 0 : win.scrollLeft() - elf.left))
}
},

Expand Down
4 changes: 3 additions & 1 deletion js/elFinder.options.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ elFinder.prototype._options = {
height : 300,
// Maximum characters length to preview
textMaxlen : 2000,
// preview window into NavDock
// quicklook window must be contained in elFinder node on window open (true|false)
contain : false,
// preview window into NavDock (true|false)
docked : false,
// Docked preview height ('auto' or Number of pixel) 'auto' is setted to the Navbar width
dockHeight : 'auto',
Expand Down

0 comments on commit 165336f

Please sign in to comment.