4 lines
1.2 KiB
JavaScript
4 lines
1.2 KiB
JavaScript
function inputPhoneSubject(a,b,c){this.tmp_id=a;this.subject_id=b;this.store_button=c}inputPhoneSubject.prototype={store_button:this.store_button,tmp_id:this.tmp_id,subject_id:this.subject_id,handler:null};inputPhoneSubject.prototype.check=function(){return 0<this.subject_id.value.length&&!isNaN(this.subject_id.value)};
|
|
inputPhoneSubject.prototype.fieldsToStorage=function(){console.group("[phone.subject] fields to storage");if(!this.check())return!1;lsi.set("p_subject",0,{tmp_id:this.tmp_id.value,subject_id:this.subject_id.value});console.groupEnd("[phone.subject] fields to storage")};inputPhoneSubject.prototype.storageToFields=function(){console.group("[phone.subject] storage to fields");var a=lsi.get("p_subject",0),a=a||{tmp_id:"",subject_id:""};this.tmp_id.value=a.tmp_id;this.subject_id.value=a.subject_id;console.groupEnd("[phone.subject] storage to fields")};
|
|
inputPhoneSubject.prototype.attach=function(a){console.group("[phone.subject] attaching events");lsi.createDataset("p_subject");lsi.createDataset("p_friends");this.handler=a;var b=this;this.store_button.addEventListener("click",function(a){b.fieldsToStorage();b.handler(!0);b.storageToFields()},!1);this.storageToFields();console.groupEnd("[phone.subject] attaching events")};
|