Skip to content

Commit

Permalink
Update avalon.progressbar.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RubyLouvre committed Jun 2, 2013
1 parent 84cb053 commit 59a787a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions avalon.progressbar.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@
while (el = element.firstChild) { while (el = element.firstChild) {
fragment.appendChild(el); 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) { while (el = element.firstChild) {
fragment.appendChild(el); fragment.appendChild(el);
} }
model = avalon.define(id, function(vm) { model = avalon.define(id, function(vm) {
vm.value = options.value; vm.value = options.value;
vm.updateValue = function(v){
if(isFinite(v)){
this.style.width = v + "%"
}
}
}); });
avalon.nextTick(function() { avalon.nextTick(function() {
element.appendChild(fragment); element.appendChild(fragment);
avalon.scan(element.parentNode, model); avalon.scan(element.parentNode, model);
}); });
return model; return model;
} }
})(this.avalon); })(this.avalon);
//6月2日 3群 上海-Jason

0 comments on commit 59a787a

Please sign in to comment.