1/** 2 * ÐÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñ - вÑÐ±Ð¾Ñ Ð³Ð¾Ñода. 3 * ÐÐ¾Ð¶ÐµÑ Ð¸ÑполÑзоваÑÑÑÑ Ð² ÑÑоÑÐ¾Ð½Ð½Ð¸Ñ Ð±Ð»Ð¾ÐºÐ°Ñ , напÑÐ¸Ð¼ÐµÑ Ð² блоке ÑÑоимоÑÑÑ Ð´Ð¾ÑÑавки в каÑÑоÑке ÑоваÑа 4 */ 5new class SelectCity extends RsJsCore.classes.component 6{ 7 constructor() 8 { 9 super(); 10 let defaults = { 11 changeCity: '.rs-change-city' //ÐлеменÑ, клик на коÑоÑÑй бÑÐ´ÐµÑ Ð¾ÑкÑÑваÑÑ Ð¾ÐºÐ½Ð¾ вÑбоÑа гоÑода 12 }; 13 14 this.settings = {...defaults, ...this.getExtendsSettings()}; 15 } 16 17 /** 18 * ÐниÑиализиÑÑÐµÑ ÐºÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñ 19 */ 20 init() { 21 this.utils.on('click', this.settings.changeCity, event => this.changeCityDialog(event)); 22 } 23 24 /** 25 * 26 * @param event 27 */ 28 changeCityDialog(event) { 29 let setAddressUrl = event.rsTarget.dataset.setAddressUrl; 30 let dialogUrl = event.rsTarget.dataset.selectAddressUrl; 31 32 this.plugins.openDialog.show({ 33 url: dialogUrl, 34 bindSubmit:false, 35 callback: (response, element) => { 36 //ÐниÑиализиÑÑем диалог вÑбоÑа гоÑода 37 new SelectedAddressChange(element, (address) => { 38 let formData = new FormData(); 39 for (let key in address) { 40 formData.append(key, address[key]); 41 } 42 43 this.utils.fetchJSON(setAddressUrl, { 44 method:'POST', 45 body: formData 46 }).then(response => { 47 if (response.success) { 48 location.replace(location.href.replace(location.hash,"")); 49 } 50 }); 51 }); 52 } 53 }); 54 } 55 56 onDocumentReady() { 57 this.init(); 58 } 59};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.