Skip to content

Commit

Permalink
[cmd:resize] fix #1834 configurable default state of 8px Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Jan 10, 2017
1 parent 1b54be2 commit ae88b57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/commands/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ elFinder.prototype.commands.resize = function() {
dialogWidth = 650,
fmnode = fm.getUI(),
ctrgrup = $().controlgroup? 'controlgroup' : 'buttonset',
grid8Def = typeof this.options.grid8px === 'undefind' || this.options.grid8px !== 'disable'? true : false,

open = function(file, id) {
var isJpeg = (file.mime === 'image/jpeg'),
Expand Down Expand Up @@ -317,7 +318,7 @@ elFinder.prototype.commands.resize = function() {
rwidth = 0,
rheight = 0,
rdegree = 0,
grid8 = isJpeg? true : false,
grid8 = isJpeg? grid8Def : false,
constr = $('<button>').html(fm.i18n('aspectRatio'))
.on('click', function() {
cratio = ! cratio;
Expand Down
4 changes: 4 additions & 0 deletions js/elFinder.options.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ elFinder.prototype._options = {
// Enable automatic switching function ["New Folder" / "Into New Folder"] of toolbar buttton
intoNewFolderToolbtn: false,
},
resize: {
// defalt status of snap to 8px grid of the jpeg image ("enable" or "disable")
grid8px : 'enable'
},
help : {view : ['about', 'shortcuts', 'help', 'debug']}
},

Expand Down

0 comments on commit ae88b57

Please sign in to comment.