Skip to content

Commit

Permalink
Merge pull request #7 from uxrocket/2.x
Browse files Browse the repository at this point in the history
2.x
  • Loading branch information
bcinarli committed Sep 11, 2015
2 parents 8bb73ff + d0e58a7 commit bc4ba51
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uxrocket.select",
"version": "2.7.2",
"version": "2.8.0",
"homepage": "https://github.com/uxrocket/uxrocket.select",
"authors": [
"Bilal Çınarlı <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion dist/uxrocket.select.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions lib/uxrocket.select.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
$current = setText($el.find(':selected').text()),
optionList = builtOptions($el);

columns = ' ' + $el.context.className.replace(ns.ready, '');
columns = ' ' + $el.context.className.replace(ns.ready, '') + ' ' + ns.wrap + '-' + _opts.index;

if(_opts.selector.charAt(0) == '.') {
columns = columns.replace(' ' + _opts.selector.substr(1), '');
Expand Down Expand Up @@ -172,6 +172,17 @@
}
});

$('body').on('DOMNodeRemoved', function(e) {
if(e.target === $el[0]) {
cleanUp(_opts.index)
}
});

};

var cleanUp = function(index) {
$('.' + ns.wrap + '-' + index).remove();
$('#' + ns.list + '-' + index).remove();
};

var toggleList = function($el) {
Expand Down Expand Up @@ -338,7 +349,7 @@
};

// Version
ux.version = "2.7.2";
ux.version = "2.8.0";

// settings
ux.settings = defaults;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uxrocket.select",
"version": "2.7.2",
"version": "2.8.0",
"description": "jQuery based Select box replacement function",
"repository": {
"type": "git",
Expand Down

0 comments on commit bc4ba51

Please sign in to comment.