Sha256: ae4bb42ad6007f295f1c3a2e0085b80fa360fa2de13394f62b97e3974e2a8d7e
Contents?: true
Size: 768 Bytes
Versions: 4
Compression:
Stored size: 768 Bytes
Contents
/** * Script to make form controls control CSS styles * Requires css-edit.js * @author Lea Verou * MIT License */ (function(){ var self = window.CSSControl = function(control) { var me = this; this.control = control; // this holds the elements the CSS is gonna be applied to this.subjects = CSSEdit.getSubjects(control); CSSEdit.setupSubjects(control); control.addEventListener('input', function() { me.update(); }, false); control.addEventListener('change', function() { me.update(); }, false); this.update(); }; self.prototype = { update: function() { // Get code var code = this.control.getAttribute('data-style').replace(/\{value\}/gi, this.control.value); CSSEdit.updateStyle(this.subjects, code, 'style'); } }; })();
Version data entries
4 entries across 4 versions & 2 rubygems