Skip to content
Browse files

Added destroy mehtod.

  • Loading branch information...
1 parent b8258c0 commit 1ca5d0ec4fd6e0a37ccc08236feba7a26321ab6f Scott Gonzalez committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 jquery.nmk.colorswatch.js
View
11 jquery.nmk.colorswatch.js
@@ -84,6 +84,17 @@ $.widget('nmk.colorswatch', {
if (this.isInput) {
this.element.val(value);
}
+ },
+
+ destroy: function() {
+ if (this.isInput) {
+ this.element.unbind('.colorswatch');
+ this.swatch.remove();
+ } else {
+ this.swatch.empty();
+ }
+
+ $.widget.prototype.destroy.apply(this, arguments);
}
});

0 comments on commit 1ca5d0e

Please sign in to comment.
Something went wrong with that request. Please try again.