NxTIC/js/includes/input-phone-subject-min.js

4 lines
1.1 KiB
JavaScript
Raw Normal View History

function inputPhoneSubject(a,b,c,d){this.tmp_id=a;this.number=b;this.username=c;this.store_button=d}inputPhoneSubject.prototype={store_button:this.store_button,tmp_id:this.tmp_id,number:this.number,username:this.username};inputPhoneSubject.prototype.check=function(){return 0<this.number.value.length&&0<this.username.value.length};
inputPhoneSubject.prototype.fieldsToStorage=function(){console.log("SUBJECT: FIELDS TO STORAGE");if(!this.check())return!1;lsi.set("p_subject",0,{tmp_id:this.tmp_id.value,number:this.number.value,username:this.username.value})};inputPhoneSubject.prototype.storageToFields=function(){console.log("SUBJECT: STORAGE TO FIELDS");var a=lsi.get("p_subject",0);null==a&&(a={tmp_id:"",number:"",username:""});this.tmp_id.value=a.tmp_id;this.number.value=a.number;this.username.value=a.username};
inputPhoneSubject.prototype.attach=function(){function a(a){b.fieldsToStorage()&&b.storageToFields()}console.log("SUBJECT: ATTACH");lsi.createDataset("p_subject");var b=this;this.store_button.addEventListener("click",a,!1);this.number.addEventListener("blur",a,!1);this.username.addEventListener("blur",a,!1);this.storageToFields()};