Skip to content

Commit

Permalink
fix #222
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed Apr 4, 2015
1 parent 6cc5c32 commit e90733d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
11 changes: 9 additions & 2 deletions lib/simditor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*!
* Simditor v2.1.5
* http://simditor.tower.im/
* 2015-04-04
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
Expand Down Expand Up @@ -4367,11 +4372,12 @@ ImagePopover = (function(superClass) {
this.widthEl.val(width);
}
if (!onlySetVal) {
return this.target.attr({
this.target.attr({
width: width || value,
height: height || value
});
}
return this.editor.trigger('valuechanged');
};

ImagePopover.prototype._restoreImg = function() {
Expand All @@ -4382,7 +4388,8 @@ ImagePopover = (function(superClass) {
height: size[1] * 1
});
this.widthEl.val(size[0]);
return this.heightEl.val(size[1]);
this.heightEl.val(size[1]);
return this.editor.trigger('valuechanged');
};

ImagePopover.prototype._loadImage = function(src, callback) {
Expand Down
6 changes: 4 additions & 2 deletions site/assets/scripts/simditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4367,11 +4367,12 @@ ImagePopover = (function(superClass) {
this.widthEl.val(width);
}
if (!onlySetVal) {
return this.target.attr({
this.target.attr({
width: width || value,
height: height || value
});
}
return this.editor.trigger('valuechanged');
};

ImagePopover.prototype._restoreImg = function() {
Expand All @@ -4382,7 +4383,8 @@ ImagePopover = (function(superClass) {
height: size[1] * 1
});
this.widthEl.val(size[0]);
return this.heightEl.val(size[1]);
this.heightEl.val(size[1]);
return this.editor.trigger('valuechanged');
};

ImagePopover.prototype._loadImage = function(src, callback) {
Expand Down
2 changes: 0 additions & 2 deletions site/assets/scripts/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,8 @@ uploader = function(opts) {
return new Uploader(opts);
};


return uploader;


}));


4 changes: 4 additions & 0 deletions src/buttons/image.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ class ImagePopover extends Popover
width: width || value
height: height || value

@editor.trigger 'valuechanged'

_restoreImg: ->
size = @target.data('image-size')?.split(",") || [@width, @height]
@target.attr
Expand All @@ -469,6 +471,8 @@ class ImagePopover extends Popover
@widthEl.val(size[0])
@heightEl.val(size[1])

@editor.trigger 'valuechanged'

_loadImage: (src, callback) ->
if /^data:image/.test(src) and not @editor.uploader
callback(false) if callback
Expand Down
2 changes: 1 addition & 1 deletion styles/simditor.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Simditor v2.1.5
* http://simditor.tower.im/
* 2015-29-03
* 2015-04-04
*/
@font-face {
font-family: 'Simditor';
Expand Down

0 comments on commit e90733d

Please sign in to comment.