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

Version Path
slideshow-service-0.3.1 lib/slideshow/service/public/slideshow-csss/plugins/css-controls.js
slideshow-service-0.3.0 lib/slideshow/service/public/slideshow-csss/plugins/css-controls.js
pleeease-0.0.3 node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/plugins/css-controls.js
pleeease-0.0.2 node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/plugins/css-controls.js