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

4 lines
1.1 KiB
JavaScript

function inputPhoneSubject(a,c,b){this.tmp_id=a;this.subject_id=c;this.store_button=b}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.log("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})};
inputPhoneSubject.prototype.storageToFields=function(){console.log("SUBJECT: STORAGE TO FIELDS");var a=lsi.get("p_subject",0);null==a&&(a={tmp_id:"",subject_id:""});this.tmp_id.value=a.tmp_id;this.subject_id.value=a.subject_id};
inputPhoneSubject.prototype.attach=function(a){function c(a){b.fieldsToStorage();b.handler(!0);b.storageToFields()}console.log("SUBJECT: ATTACH");lsi.createDataset("p_subject");lsi.createDataset("p_friends");this.handler=a;var b=this;this.store_button.addEventListener("click",c,!1);this.subject_id.addEventListener("blur",c,!1);this.storageToFields()};