Changeset 5142
- Timestamp:
- 03/28/08 16:42:08 (7 months ago)
- Files:
-
- 1 modified
-
trunk/ui/colorpicker/ui.colorpicker.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/colorpicker/ui.colorpicker.js
r5141 r5142 19 19 var self = this; 20 20 this.element = $(element); 21 var o = $.extend({}, this.options);21 var o = this.options = $.extend({}, options); 22 22 23 23 $.data(element, "colorpicker", this); … … 58 58 self.lastValues = [parseInt(ui.value.x * 255/100),parseInt(ui.value.y * 255/100)]; 59 59 self.setGradientColor(); 60 self.propagate("picking", e); 60 61 }, 61 change : function( ) {62 change : function(e) { 62 63 self.colorfieldLast.css("backgroundColor", 'rgb(' + self.currentColor.r + ',' + self.currentColor.g + ',' + self.currentColor.b + ')'); 63 } 64 self.propagate("change", e); 65 }, 66 stop: function(e) { self.propagate("pick", e); }, 67 start: function(e) { self.propagate("start", e); } 64 68 }); 65 69 … … 69 73 self.setVertColor(parseInt(ui.value * 255 / 100)); 70 74 self.setGradientColor(); 75 self.propagate("picking", e); 71 76 }, 72 change : function( ) {77 change : function(e) { 73 78 self.colorfieldLast.css("backgroundColor", 'rgb(' + self.currentColor.r + ',' + self.currentColor.g + ',' + self.currentColor.b + ')'); 74 } 79 self.propagate("change", e); 80 }, 81 stop: function(e) { self.propagate("pick", e); }, 82 start: function(e) { self.propagate("start", e); } 75 83 }); 76 84 … … 84 92 instance: this, 85 93 options: this.options, 86 element: this.element 94 element: this.element, 95 rgb: this.currentColor, 96 hex: (this.toHex(this.currentColor.r) + this.toHex(this.currentColor.g) + this.toHex(this.currentColor.b)).toUpperCase() 87 97 }; 88 98 }, … … 125 135 $('input.ui-colorpicker-rgbB', this.element)[0].value = b; 126 136 $('input.ui-colorpicker-hex', this.element)[0].value = (this.toHex(r) + this.toHex(g) + this.toHex(b)).toUpperCase(); 127 currentColor = {r:r,g:g,b:b};137 this.currentColor = {r:r,g:g,b:b}; 128 138 }, 129 139 toHex: function(color){
