167 | | // w, h are the new full size dims |
168 | | max1 = Math.max( t.hold.w, t.hold.h ); |
169 | | max2 = Math.max( $(img).width(), $(img).height() ); |
170 | | t.hold['sizer'] = max1 > max2 ? max2 / max1 : 1; |
| 167 | // w, h are the new full size dims |
| 168 | max1 = Math.max( t.hold.w, t.hold.h ); |
| 169 | max2 = Math.max( $(img).width(), $(img).height() ); |
| 170 | t.hold['sizer'] = max1 > max2 ? max2 / max1 : 1; |
178 | | if ( $('#imgedit-history-' + postid).val() && $('#imgedit-undone-' + postid).val() == 0 ) |
179 | | $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).removeAttr('disabled'); |
180 | | else |
181 | | $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true); |
| 178 | if ( $('#imgedit-history-' + postid).val() && $('#imgedit-undone-' + postid).val() == 0 ) |
| 179 | $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).removeAttr('disabled'); |
| 180 | else |
| 181 | $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true); |
183 | | t.toggleEditor(postid, 0); |
184 | | }).error(function(){ |
185 | | $('#imgedit-crop-' + postid).empty().append('<div class="error"><p>' + imageEditL10n.error + '</p></div>'); |
186 | | t.toggleEditor(postid, 0); |
187 | | }).attr('src', ajaxurl + '?' + $.param(data)); |
| 183 | t.toggleEditor(postid, 0); |
| 184 | }) |
| 185 | .on('error', function() { |
| 186 | $('#imgedit-crop-' + postid).empty().append('<div class="error"><p>' + imageEditL10n.error + '</p></div>'); |
| 187 | t.toggleEditor(postid, 0); |
| 188 | }) |
| 189 | .attr('src', ajaxurl + '?' + $.param(data)); |