From 0da8088a48358f5bc0fe098183a7c5fa87ffb9b6 Mon Sep 17 00:00:00 2001 From: farthinker Date: Thu, 7 May 2015 17:32:19 +0800 Subject: [PATCH] bug fix && publish v2.0.6 --- Gruntfile.coffee | 2 +- bower.json | 2 +- lib/select.js | 4 ++-- package.json | 8 +++++++- src/select.coffee | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index b914558..a79e8d0 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -33,7 +33,7 @@ module.exports = (grunt) -> deps: 'default': ['$', 'SimpleModule', 'simpleUtil'] amd: ['jquery', 'simple-module', 'simple-util'] - cjs: ['jquery', 'simple-module', 'simple-util'] + cjs: ['jquery', 'simplemodule', 'simple-util'] global: items: ['jQuery', 'SimpleModule', 'simple.util'] prefix: '' diff --git a/bower.json b/bower.json index 6b8b0de..a18cb48 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "simple-select", - "version": "2.0.5", + "version": "2.0.6", "homepage": "https://github.com/mycolorway/simple-select", "authors": [ "kshift " diff --git a/lib/select.js b/lib/select.js index 5836235..698e2f8 100644 --- a/lib/select.js +++ b/lib/select.js @@ -8,7 +8,7 @@ // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. - module.exports = factory(require("jquery"),require("simple-module"),require("simple-util")); + module.exports = factory(require("jquery"),require("simplemodule"),require("simple-util")); } else { root.simple = root.simple || {}; root.simple['select'] = factory(jQuery,SimpleModule,simple.util); @@ -69,7 +69,7 @@ Select = (function(superClass) { 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.select = $(Select._tpl.select).data("select", this).addClass(this.opts.cls).insertBefore(this.el); this.input = $(Select._tpl.input).attr("placeholder", this.el.data("placeholder") || this.opts.placeholder).prependTo(this.select); this.list = this.select.find(".select-list"); this.requireSelect = true; diff --git a/package.json b/package.json index 0b48f8f..0728779 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-select", - "version": "2.0.5", + "version": "2.0.6", "description": "a simple select plugin based on Simple Module", "repository": { "type": "git", @@ -12,6 +12,12 @@ "url": "https://github.com/mycolorway/simple-select/issues" }, "homepage": "https://github.com/mycolorway/simple-select", + "dependencies": { + "jquery": "2.x", + "simplemodule": "2.x", + "jquery-mousewheel": "3.x", + "simple-util": "2.x" + }, "devDependencies": { "grunt": "0.x", "grunt-contrib-watch": "0.x", diff --git a/src/select.coffee b/src/select.coffee index 17055c5..980508e 100644 --- a/src/select.coffee +++ b/src/select.coffee @@ -57,7 +57,7 @@ class Select extends SimpleModule @select = $(Select._tpl.select) .data("select", @) .addClass(@opts.cls) - .insertAfter @el + .insertBefore @el @input = $(Select._tpl.input) .attr("placeholder", @el.data("placeholder") or @opts.placeholder) .prependTo @select