xooie 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ab042b8a8738d53a37ca8896d4cdc6a58240e40
4
- data.tar.gz: 092d46a6f2abd0b7142c5d7325e2bcc5a86baafa
3
+ metadata.gz: 5bfa0215451441d23096e198c657f95002a8d646
4
+ data.tar.gz: f6a47ae7db3b4133f1ee0e704048b4e03a6c712c
5
5
  SHA512:
6
- metadata.gz: 072980e920a4abd117dbc89b6136d0baf1101c56bfe45021983afb0d5fdcd6b1bd46e9c9c0129acd184c591aed11b24150994ddba644783328b90d97a17b6eef
7
- data.tar.gz: 9e1241ae13314e68ce0fb9b195f0924dee1120026dd5335428b08ad0e73b82e19b69db9e99c37c6d7037e92bcb04ffb161eee4c3ebf79c2d12ce2ca1595b8fdb
6
+ metadata.gz: f481dcef343b05cb64051d8ea384c306bff9b52b4174c155a4fb8ba8b55e805687aa5c307026af13dc48e2b2f15cac594d133c3789a43dd635b79a56a83a6381
7
+ data.tar.gz: c733687187db37e5c6d6a5beea8cfb2f6ae0fae51b9b2a943f2acc1926ea03e89901f534008f95ae260f63d0e620a8c9002484f670fd05aed902a7f51c99b5ee
@@ -54,6 +54,9 @@ define('xooie/addons/base', ['jquery', 'xooie/shared'], function($, shared) {
54
54
 
55
55
  widget.root().addClass(this.addonClass());
56
56
 
57
+ // Set the default options
58
+ shared.setData(this, widget.root().data());
59
+
57
60
  // Reference the widget:
58
61
  this.widget(widget);
59
62
 
@@ -167,9 +167,27 @@ define('xooie/shared', ['jquery'], function($){
167
167
  if (typeof instance[prop.setter] === 'function') {
168
168
  instance[prop.setter](value);
169
169
  }
170
+ },
171
+
172
+ /**
173
+ * Xooie.shared.setData(instance, data)
174
+ * - instance (Widget | Addon): The instance to set data on
175
+ * - data (Object): A collection of key/value pairs
176
+ *
177
+ * Sets the properties to the values specified, as long as the property has been defined
178
+ **/
179
+ setData: function(instance, data) {
180
+ var i, prop;
181
+
182
+ for (i = 0; i < instance._definedProps.length; i++) {
183
+ prop = instance._definedProps[i];
184
+ if (typeof data[prop] !== 'undefined') {
185
+ instance.set(prop, data[prop]);
186
+ }
187
+ }
170
188
  }
171
189
 
172
190
  };
173
191
 
174
192
  return shared;
175
- });
193
+ });
@@ -123,7 +123,7 @@ define('xooie/widgets/base', ['jquery', 'xooie/xooie', 'xooie/helpers', 'xooie/s
123
123
  element = $(element);
124
124
 
125
125
  //set the default options
126
- this._setData(element.data());
126
+ shared.setData(this, element.data());
127
127
 
128
128
  //do instance tracking
129
129
  if (element.data('xooieInstance')) {
@@ -468,22 +468,6 @@ define('xooie/widgets/base', ['jquery', 'xooie/xooie', 'xooie/helpers', 'xooie/s
468
468
 
469
469
  //PROTOTYPE DEFINITIONS
470
470
 
471
- /** internal
472
- * Xooie.widget#_setData(data)
473
- * - data (Object): A collection of key/value pairs.
474
- *
475
- * Sets the properties to the values specified, as long as the property has been defined.
476
- **/
477
- Widget.prototype._setData = function(data) {
478
- var i;
479
-
480
- for (i = 0; i < this._definedProps.length; i+=1) {
481
- if (typeof data[this._definedProps[i]] !== 'undefined') {
482
- this.set(this._definedProps[i], data[this._definedProps[i]]);
483
- }
484
- }
485
- };
486
-
487
471
  /**
488
472
  * Xooie.Widget#get(name) -> object
489
473
  * - name (String): The name of the property to be retrieved.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xooie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Larkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-21 00:00:00.000000000 Z
11
+ date: 2013-10-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A highly modular, extensible JavaScript UI framework.
14
14
  email: andrewlarkin2@gmail.com