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

3 lines
1.0 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.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),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){console.log("SUBJECT: ATTACH");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()};