diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index a11d225..0000000 --- a/.rvmrc +++ /dev/null @@ -1,5 +0,0 @@ -if [[ -n "$rvm_path/environments" && -s "$rvm_path/environments/ruby-1.9.2-p180@bb.mb" ]] ; then - \. "$rvm_path/environments/ruby-1.9.2-p180@bb.mb" -else - rvm --create "ruby-1.9.2-p180@bb.mb" -fi diff --git a/backbone.modelbinding.js b/backbone.modelbinding.js index db1f68c..b68a15b 100644 --- a/backbone.modelbinding.js +++ b/backbone.modelbinding.js @@ -98,15 +98,15 @@ var modelbinding = (function(Backbone, _, $) { } } - this.getBindingAttr = function(type){ - return this.bindingAttrConfig[type]; - }; + }; - this.getBindingValue = function(element, type){ - var bindingAttr = this.getBindingAttr(type); - return element.attr(bindingAttr); - }; + modelBinding.Configuration.prototype.getBindingAttr = function(type){ + return this.bindingAttrConfig[type]; + }; + modelBinding.Configuration.prototype.getBindingValue = function(element, type){ + var bindingAttr = this.getBindingAttr(type); + return element.attr(bindingAttr); }; modelBinding.Configuration.bindindAttrConfig = { @@ -424,10 +424,14 @@ var modelbinding = (function(Backbone, _, $) { val = modelBinding.Configuration.getDataBindSubst(attr, val); switch(attr){ case "html": - element.html(val); + if ((typeof val !== 'undefined') && (val !== null)) { + element.html(val); + } break; case "text": - element.text(val); + if ((typeof val !== 'undefined') && (val !== null)) { + element.text(val); + } break; case "enabled": element.attr("disabled", !val);