Skip to content

Commit

Permalink
upgrade to be compatible with simditor 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed Jul 29, 2015
1 parent 725fa4e commit 809cdda
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simditor-html",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "https://github.com/mycolorway/simditor-html",
"authors": [
"farthinker <[email protected]>"
Expand All @@ -25,7 +25,7 @@
],
"dependencies": {
"jquery": "~2.1.4",
"simditor": "~2.1.9",
"simditor": "~2.2.0",
"js-beautify": "~1.5.5"
}
}
6 changes: 2 additions & 4 deletions lib/simditor-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ HTMLButton = (function(superClass) {
})(this));
};

HTMLButton.prototype.status = function($node) {
return true;
};
HTMLButton.prototype.status = function() {};

HTMLButton.prototype.command = function() {
var button, i, len, ref;
Expand Down Expand Up @@ -91,7 +89,7 @@ HTMLButton = (function(superClass) {

HTMLButton.prototype._resizeTextarea = function() {
this._textareaPadding || (this._textareaPadding = this.editor.textarea.innerHeight() - this.editor.textarea.height());
return this.editor.textarea.height(0).height(this.editor.textarea[0].scrollHeight - this._textareaPadding);
return this.editor.textarea.height(this.editor.textarea[0].scrollHeight - this._textareaPadding);
};

return HTMLButton;
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "simditor-html",
"description": "HTML source editing plugin for simditor",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "https://github.com/mycolorway/simditor-html",
"author": {
"name": "farthinker",
Expand All @@ -27,8 +27,7 @@
},
"dependencies": {
"jquery": "~2.1.4",
"simditor": "~2.1.9",
"simditor": "~2.2.0",
"js-beautify": "~1.5.5"
},
"keywords": []
}
}
7 changes: 3 additions & 4 deletions src/simditor-html.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class HTMLButton extends Simditor.Button
@editor.textarea.on 'input', (e) =>
@_resizeTextarea()

status: ($node) ->
true
status: ->

command: ->
@editor.blur()
Expand Down Expand Up @@ -52,7 +51,7 @@ class HTMLButton extends Simditor.Button

_resizeTextarea: ->
@_textareaPadding ||= @editor.textarea.innerHeight() - @editor.textarea.height()
@editor.textarea.height(0)
.height (@editor.textarea[0].scrollHeight - @_textareaPadding)
@editor.textarea
.height(@editor.textarea[0].scrollHeight - @_textareaPadding)

Simditor.Toolbar.addButton HTMLButton

0 comments on commit 809cdda

Please sign in to comment.