Skip to content

Commit

Permalink
#49 - passed the control ID in the event arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
soundar24 committed Nov 20, 2016
1 parent 3eb9dd6 commit 64ce9ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/roundslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,8 @@
_raise: function (event, args) {
var o = this.options, fn = o[event], val = true;
args = args || { value: o.value };
args["id"] = this.id;
args["control"] = this.control;
args["options"] = o;
if (fn) {
args["type"] = event;
Expand All @@ -957,7 +959,7 @@
val = val === false ? false : val;
}
}
this.control.trigger($.Event ? $.Event(event, args) : event);
this.control.trigger($.Event(event, args));
return val;
},
_bind: function (element, _event, handler) {
Expand Down Expand Up @@ -1160,6 +1162,7 @@
// The plugin constructor
function RoundSlider(control, options) {
if (control.id) window[control.id] = this;
this.id = control.id;
this.control = $(control);

// the options value holds the updated defaults value
Expand Down

0 comments on commit 64ce9ff

Please sign in to comment.