Skip to content

Commit

Permalink
Merge pull request #5 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 ee41f95 + f756e1c commit ae65f68
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 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.1",
"version": "2.7.2",
"homepage": "https://github.com/uxrocket/uxrocket.select",
"authors": [
"Bilal Çınarlı <[email protected]>"
Expand Down
15 changes: 11 additions & 4 deletions lib/uxrocket.select.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
if($el.is('.readonly')) {
columns += ' ' + ns.readonly;
}
if($el.is(':disabled')){

if($el.is(':disabled')) {
columns += ' ' + ns.disabled
}

Expand Down Expand Up @@ -188,7 +188,7 @@

var selectOption = function($option) {
var $list = $option.parents('.' + ns.list),
$el = $("#" + $list.data('select')),
$el = $(escapeSelector("#" + $list.data('select'))),
_opts = $el.data(ns.data),
$v = $option.data('value');

Expand Down Expand Up @@ -231,6 +231,13 @@
return text.replace(/\[/g, '<').replace(/]/g, '>');
};

var escapeSelector = function(selector) {
var is_ID = selector.charAt(0) === '#',
re = /([ !"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~])/g;

return is_ID ? '#' + selector.substring(1).replace(re, '\\$1') : selector;
};

// global callback
var callback = function(fn) {
// if callback string is function call it directly
Expand Down Expand Up @@ -331,7 +338,7 @@
};

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

// 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.1",
"version": "2.7.2",
"description": "jQuery based Select box replacement function",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion tests/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
</p>

<p class="wrap">
<select id="sample-02" class="select" data-on-select="selected(event)" data-wrapper="sample-wrapper">
<select id="sample:02" class="select" data-on-select="selected(event)" data-wrapper="sample-wrapper">
<option value="34">İstanbul</option>
<option value="06">Ankara</option>
<option value="35">İzmir</option>
Expand Down

0 comments on commit ae65f68

Please sign in to comment.