Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Introduce inline option - when set to true, the elements are div, whe…

…n false - spans, when null - options.tag
  • Loading branch information...
commit d03d40d68a4ff0432d1847304f2c4641d05462c5 1 parent 2c6e96f
authored May 02, 2011
7  Source/Module/Accessories/Element.js
@@ -21,7 +21,8 @@ provides:
21 21
 LSD.Module.Element = new Class({
22 22
   options: {
23 23
     key: 'node',
24  
-    reusable: true
  24
+    reusable: true,
  25
+    inline: null
25 26
   },
26 27
   
27 28
   initializers: {
@@ -69,7 +70,9 @@ LSD.Module.Element = new Class({
69 70
   },
70 71
   
71 72
   build: function() {
72  
-    var options = this.options, attrs = Object.append({tag: options.tag, element: this.element}, options.element);
  73
+    var options = this.options, attrs = Object.append({element: this.element}, options.element);
  74
+    if (!attrs.tag)
  75
+      attrs.tag = ((this.options.inline == null) && options.tag) || (options.inline ? 'span' : 'div'); 
73 76
     this.fireEvent('beforeBuild', attrs);
74 77
     var stop = (attrs.convert === false), tag = attrs.tag;
75 78
     delete attrs.convert, delete attrs.tag, delete attrs.element;
6  Source/Native.js
@@ -20,14 +20,10 @@ provides:
20 20
 
21 21
 LSD.Native = new Class({
22 22
   Extends: LSD.Widget,
23  
-  
24 23
   options: {
25  
-    element: {
26  
-      tag: null
27  
-    }
  24
+    inline: null //use widget tag when no element tag specified
28 25
   }
29 26
 });
30  
-
31 27
 new LSD.Type('Native');
32 28
 
33 29
 // Inject native widgets into default widget pool as a fallback
2  Source/Sheet.js
@@ -36,7 +36,7 @@ LSD.Sheet = new Class({
36 36
   },
37 37
   
38 38
   initialize: function(element, callback) {
39  
-    LSD.Module.Options.initialize.call(element);
  39
+    LSD.Module.Options.initialize.call(this, element);
40 40
     this.rules = [];
41 41
     this.callback = callback;
42 42
     if (this.element) this.fetch();
4  Source/Widget.js
@@ -44,12 +44,10 @@ LSD.Widget = new Class({
44 44
   ],
45 45
   
46 46
   options: {
47  
-    element: {
48  
-      tag: 'div'
49  
-    },
50 47
     key: 'widget',
51 48
     writable: false,
52 49
     layers: true,
  50
+    inline: false
53 51
   },
54 52
   
55 53
   initializers: {

0 notes on commit d03d40d

Please sign in to comment.
Something went wrong with that request. Please try again.