Permalink
Browse files

Update avalon.progressbar.js

  • Loading branch information...
1 parent 84cb053 commit 59a787a1197c153f8c86b22fb64d7444d3fcb388 @RubyLouvre committed Jun 2, 2013
Showing with 8 additions and 2 deletions.
  1. +8 −2 avalon.progressbar.js
View
10 avalon.progressbar.js
@@ -13,17 +13,23 @@
while (el = element.firstChild) {
fragment.appendChild(el);
}
- element.innerHTML = '<div class="ui-progressbar-value ui-widget-header ui-corner-left ui-corner-right" style="width:' + options.value + '%;"></div>';
+ element.innerHTML = '<div class="ui-progressbar-value ui-widget-header ui-corner-left ui-corner-right" ms-bind-value="updateValue" style="width:' + options.value + '%;"></div>';
while (el = element.firstChild) {
fragment.appendChild(el);
}
model = avalon.define(id, function(vm) {
vm.value = options.value;
+ vm.updateValue = function(v){
+ if(isFinite(v)){
+ this.style.width = v + "%"
+ }
+ }
});
avalon.nextTick(function() {
element.appendChild(fragment);
avalon.scan(element.parentNode, model);
});
return model;
}
-})(this.avalon);
+})(this.avalon);
+//6月2日 3群 上海-Jason

0 comments on commit 59a787a

Please sign in to comment.