silverstripe-subsites/client/dist/js/SubsitesTreeDropdownField.js

1 line
756 B
JavaScript

!function(){"use strict";var e={669:function(e){e.exports=jQuery}},t={};function r(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,r),o.exports}!function(){var e=r(669);e.entwine("ss",(e=>{e("select.subsitestreedropdownfield-chooser").entwine({onchange(){const t=this.attr("name").replace("_SubsiteID",""),r=e(`#Form_EditForm_${t}`).first();r.setValue(0),r.refresh(),r.trigger("change")}}),e(".TreeDropdownField.SubsitesTreeDropdownField").entwine({getAttributes(){const t=this.attr("id").replace("Form_EditForm_",""),r=e(`#Form_EditForm_${t}_SubsiteID option:selected`).val(),s=this._super();return s.data.urlTree+=`?${t}_SubsiteID=${r}`,s.data.cacheKey=`${s.data.cacheKey.substring(0,19)}_${r}`,s}})}))}()}();