Permalink
Browse files

BehaviorAPI now always returns an object for options; was breaking fo…

…r elements that had options defined as a property but an empty value.
  • Loading branch information...
1 parent c07bd2c commit 8a3406c1b8b145438a2fd582e554a70ee5259552 @anutron committed Sep 27, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 Source/BehaviorAPI.js
@@ -98,6 +98,7 @@ provides: [BehaviorAPI]
try {
if (!this.options){
var options = this.element.getData(this.prefix + '-options', '{}');
+ if (options === "") return this.options = {};
if (options && options.substring(0,1) != '{') options = '{' + options + '}';
var isSecure = JSON.isSecure(options);
if (!isSecure) throw new Error('warning, options value for element is not parsable, check your JSON format for quotes, etc.');

0 comments on commit 8a3406c

Please sign in to comment.