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

4 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-09-27 14:13:51 +00:00
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;var a={tmp_id:this.tmp_id.value,subject_id:this.subject_id.value};console.log(1,this.tmp_id);console.log(2,this.subject_id);lsi.set("p_subject",0,a)};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()};