Sha256: e3f7a4ed29477e8eadd6dc353170c28367fa2ae94e3c3c52528320591f000e5d
Contents?: true
Size: 1.25 KB
Versions: 3
Compression:
Stored size: 1.25 KB
Contents
/* --- script: Container.js description: Makes widget use container - wrapper around content setting license: Public domain (http://unlicense.org). authors: Yaroslaff Fedin requires: - LSD.Module.DOM provides: - LSD.Module.Container ... */ LSD.Module.Container = new Class({ options: { container: { enabled: false, position: null, inline: true, attributes: { 'class': 'container' } }, proxies: { container: { container: function() { return document.id(this.getContainer()) //creates container, once condition is true }, condition: function() { //turned off by default return this.options.container.enabled; }, priority: -1, //lowest priority rewrite: false //does not rewrite parent } } }, getContainer: Macro.getter('container', function() { var options = this.options.container; if (!options.enabled) return; var tag = options.tag || (options.inline ? 'span' : 'div'); return new Element(tag, options.attributes).inject(this.element, options.position); }), getWrapper: function() { return this.getContainer() || this.toElement(); } });
Version data entries
3 entries across 3 versions & 1 rubygems