diff --git a/bower.json b/bower.json index cde5e72..6b8b0de 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "simple-select", - "version": "2.0.4", + "version": "2.0.5", "homepage": "https://github.com/mycolorway/simple-select", "authors": [ "kshift " @@ -31,4 +31,3 @@ "simple-util": "2.x" } } - diff --git a/lib/select.js b/lib/select.js index a1517e5..5836235 100644 --- a/lib/select.js +++ b/lib/select.js @@ -48,7 +48,6 @@ Select = (function(superClass) { }; Select._tpl = { - select: "
\n \n \n \n \n \n \n
\n
" + (Select.prototype._t('loading')) + "...
\n
\n
", input: "", item: "
\n \n
" }; @@ -68,6 +67,7 @@ Select = (function(superClass) { Select.prototype._render = function() { var idx, it, items, j, len, results1; + Select._tpl.select = "
\n \n \n \n \n \n \n
\n
" + (this._t('loading')) + "...
\n
\n
"; this.el = $(this.opts.el).hide(); this.select = $(Select._tpl.select).data("select", this).addClass(this.opts.cls).insertAfter(this.el); this.input = $(Select._tpl.input).attr("placeholder", this.el.data("placeholder") || this.opts.placeholder).prependTo(this.select); diff --git a/package.json b/package.json index 07db279..0b48f8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-select", - "version": "2.0.4", + "version": "2.0.5", "description": "a simple select plugin based on Simple Module", "repository": { "type": "git", diff --git a/src/select.coffee b/src/select.coffee index 9f9d562..17055c5 100644 --- a/src/select.coffee +++ b/src/select.coffee @@ -7,7 +7,6 @@ class Select extends SimpleModule placeholder: "" allowInput: false - @i18n: "zh-CN": all_options: "ๆ‰€ๆœ‰้€‰้กน" @@ -19,20 +18,6 @@ class Select extends SimpleModule loading: "loading" @_tpl: - select: """ -
- - - - - - -
-
#{@::_t('loading')}...
-
-
- """ - input: """ """ @@ -43,7 +28,6 @@ class Select extends SimpleModule """ - _init: -> unless @opts.el throw "simple select: option el is required" @@ -55,6 +39,20 @@ class Select extends SimpleModule _render: -> + Select._tpl.select = """ +
+ + + + + + +
+
#{@_t('loading')}...
+
+
+ """ + @el = $(@opts.el).hide() @select = $(Select._tpl.select) .data("select", @)