mirror of https://github.com/luileito/jsketch.git
Added postprocessing options
This commit is contained in:
parent
0a4ff8ba75
commit
f1a0b04bdf
|
|
@ -49,10 +49,7 @@
|
||||||
// Fix Chrome "bug".
|
// Fix Chrome "bug".
|
||||||
this.onselectstart = function(){ return false };
|
this.onselectstart = function(){ return false };
|
||||||
}
|
}
|
||||||
if (options.cssCursors) {
|
postProcess(elem, options);
|
||||||
// Visually indicate whether this element is interactive or not.
|
|
||||||
elem[0].style.cursor = options.interactive ? "pointer" : "not-allowed";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var sketch = new jSketch(this, options.graphics);
|
var sketch = new jSketch(this, options.graphics);
|
||||||
// Reconfigure element data.
|
// Reconfigure element data.
|
||||||
|
|
@ -88,6 +85,7 @@
|
||||||
return this.each(function(){
|
return this.each(function(){
|
||||||
var elem = $(this), data = elem.data(_ns);
|
var elem = $(this), data = elem.data(_ns);
|
||||||
data.options = $.extend(true, {}, $.fn.sketchable.defaults, data.options, opts || {});
|
data.options = $.extend(true, {}, $.fn.sketchable.defaults, data.options, opts || {});
|
||||||
|
postProcess(elem);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -287,6 +285,17 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
function postProcess(elem, options) {
|
||||||
|
if (!options) options = elem.data(_ns).options;
|
||||||
|
if (options.cssCursors) {
|
||||||
|
// Visually indicate whether this element is interactive or not.
|
||||||
|
elem[0].style.cursor = options.interactive ? "pointer" : "not-allowed";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue