From 809cdda44b1763492a37ed78f5529fdf5730c3e0 Mon Sep 17 00:00:00 2001 From: farthinker Date: Wed, 29 Jul 2015 13:31:01 +0800 Subject: [PATCH] upgrade to be compatible with simditor 2.2.0 --- bower.json | 4 ++-- lib/simditor-html.js | 6 ++---- package.json | 7 +++---- src/simditor-html.coffee | 7 +++---- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/bower.json b/bower.json index aa6b739..f076920 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "simditor-html", - "version": "1.0.1", + "version": "1.0.2", "homepage": "https://github.com/mycolorway/simditor-html", "authors": [ "farthinker " @@ -25,7 +25,7 @@ ], "dependencies": { "jquery": "~2.1.4", - "simditor": "~2.1.9", + "simditor": "~2.2.0", "js-beautify": "~1.5.5" } } diff --git a/lib/simditor-html.js b/lib/simditor-html.js index c820c1a..d85ebc9 100644 --- a/lib/simditor-html.js +++ b/lib/simditor-html.js @@ -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; @@ -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; diff --git a/package.json b/package.json index 4b881aa..fd8856f 100644 --- a/package.json +++ b/package.json @@ -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", @@ -27,8 +27,7 @@ }, "dependencies": { "jquery": "~2.1.4", - "simditor": "~2.1.9", + "simditor": "~2.2.0", "js-beautify": "~1.5.5" - }, - "keywords": [] + } } diff --git a/src/simditor-html.coffee b/src/simditor-html.coffee index f9814d5..8ebfce6 100644 --- a/src/simditor-html.coffee +++ b/src/simditor-html.coffee @@ -23,8 +23,7 @@ class HTMLButton extends Simditor.Button @editor.textarea.on 'input', (e) => @_resizeTextarea() - status: ($node) -> - true + status: -> command: -> @editor.blur() @@ -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