diff options
author | wei <> | 2006-10-06 03:46:05 +0000 |
---|---|---|
committer | wei <> | 2006-10-06 03:46:05 +0000 |
commit | fe60cc221f922ea362826e2d00431c5df28fe85f (patch) | |
tree | 9c0449718a862a5b51d62c4ac9697db15c13863f /framework/Web/Javascripts/js/compressed/ajax.js | |
parent | 9fee2935d91e92235b068632d3608c748ef41bfe (diff) |
fixed #410 #412
Diffstat (limited to 'framework/Web/Javascripts/js/compressed/ajax.js')
-rw-r--r-- | framework/Web/Javascripts/js/compressed/ajax.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js index 4c3a8146..696968c7 100644 --- a/framework/Web/Javascripts/js/compressed/ajax.js +++ b/framework/Web/Javascripts/js/compressed/ajax.js @@ -302,28 +302,28 @@ this.showLabel();}},onTextChanged:function(text) {this.isSaving=false;this.isEditing=false;this.showLabel();},onTextChangedSuccess:function(sender,parameter) {this.isSaving=false;this.isEditing=false;if(this.options.AutoHide) this.showLabel();this.element.innerHTML=parameter==null?this.editField.value:parameter;this.editField.disabled=false;},onTextChangedFailure:function(sender,parameter) -{this.editField.disabled=false;this.isSaving=false;this.isEditing=false;}});Prado.WebUI.TRatingList=Base.extend({selectedIndex:-1,enabled:true,constructor:function(options) +{this.editField.disabled=false;this.isSaving=false;this.isEditing=false;}});Prado.WebUI.TRatingList=Base.extend({selectedIndex:-1,enabled:true,readOnly:false,constructor:function(options) {var cap=$(options.CaptionID);this.options=Object.extend({caption:cap?cap.innerHTML:''},options||{});Prado.WebUI.TRatingList.register(this);this._init();this.selectedIndex=options.SelectedIndex;this.setRating(this.selectedIndex);},_init:function(options) -{Element.addClassName($(this.options.ListID),this.options.Style);var radios=document.getElementsByName(this.options.ListName);this.radios=new Array();var index=0;for(var i=0;i<radios.length;i++) -{var node=radios[i].parentNode;if(node.tagName.toLowerCase()=='td') -{this.radios.push(radios[i]);Event.observe(node,"mouseover",this.hover.bindEvent(this,index));Event.observe(node,"mouseout",this.recover.bindEvent(this,index));Event.observe(node,"click",this.click.bindEvent(this,index));index++;Element.addClassName(node,"rating");}}},hover:function(ev,index) +{Element.addClassName($(this.options.ListID),this.options.Style);this.radios=new Array();var index=0;for(var i=0;i<this.options.ItemCount;i++) +{var radio=$(this.options.ListID+'_c'+i);var td=radio.parentNode;if(radio&&td.tagName.toLowerCase()=='td') +{this.radios.push(radio);Event.observe(td,"mouseover",this.hover.bindEvent(this,index));Event.observe(td,"mouseout",this.recover.bindEvent(this,index));Event.observe(td,"click",this.click.bindEvent(this,index));index++;Element.addClassName(td,"rating");}}},hover:function(ev,index) {if(this.enabled==false)return;for(var i=0;i<this.radios.length;i++) {var action=i<=index?'addClassName':'removeClassName' -Element[action](this.radios[i].parentNode,"rating_hover");} +Element[action](this.radios[i].parentNode,"rating_selected");} this.setCaption(index);},recover:function(ev,index) {if(this.enabled==false)return;for(var i=0;i<=index;i++) -Element.removeClassName(this.radios[i].parentNode,"rating_hover");this.setRating(this.selectedIndex);},click:function(ev,index) +Element.removeClassName(this.radios[i].parentNode,"rating_selected");this.setRating(this.selectedIndex);},click:function(ev,index) {if(this.enabled==false)return;for(var i=0;i<this.radios.length;i++) -this.radios[i].checked=(i==index);this.selectedIndex=index;this.setRating(index);var requestOptions=Object.extend({ID:this.options.ListID+"_c"+index,EventTarget:this.options.ListName+"$c"+index},this.options);var request=new Prado.CallbackRequest(requestOptions.EventTarget,requestOptions);if(request.dispatch()==false) +this.radios[i].checked=(i==index);this.selectedIndex=index;this.setRating(index);var requestOptions=Object.extend({ID:this.options.ListID+"_c"+index,EventTarget:this.options.ListID+"$c"+index},this.options);var request=new Prado.CallbackRequest(requestOptions.EventTarget,requestOptions);if(request.dispatch()==false) Event.stop(ev);},setRating:function(index) {for(var i=0;i<this.radios.length;i++) -{var action=i<=index?'addClassName':'removeClassName' +{var node=this.radios[i].parentNode;var action=i>index?'removeClassName':'addClassName' Element[action](this.radios[i].parentNode,"rating_selected");} this.setCaption(index);},setCaption:function(index) -{var value=index>-1?this.radios[index].value:this.options.caption;var caption=$(this.options.CaptionID);if(caption)caption.innerHTML=value;$(this.options.ListName).title=value;},setEnabled:function(value) +{var value=index>-1?this.radios[index].value:this.options.caption;var caption=$(this.options.CaptionID);if(caption)caption.innerHTML=value;$(this.options.ListID).title=value;},setEnabled:function(value) {this.enabled=value;for(var i=0;i<this.radios.length;i++) {var action=value?'removeClassName':'addClassName' -Element[action](this.radios[i].parentNode,"rating_disabled");Element.removeClassName(this.radios[i].parentNode,"rating_hover");}}},{ratings:{},register:function(rating) +Element[action](this.radios[i].parentNode,"rating_disabled");}}},{ratings:{},register:function(rating) {Prado.WebUI.TRatingList.ratings[rating.options.ListID]=rating;},setEnabled:function(id,value) {Prado.WebUI.TRatingList.ratings[id].setEnabled(value);},setRating:function(id,value) {Prado.WebUI.TRatingList.ratings[id].setRating(value);Prado.WebUI.TRatingList.ratings[id].selectedIndex=value;}});
\ No newline at end of file |