diff --git a/assets/js/build/init_create_worksell.js b/assets/js/build/init_create_worksell.js index 881f927..69096f3 100644 --- a/assets/js/build/init_create_worksell.js +++ b/assets/js/build/init_create_worksell.js @@ -887,19 +887,24 @@ this._fillOptionsData(); this._bindEvents(); } + }, { + key: 'setElementById', + value: function setElementById(id) { + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), 'setElementById', this).call(this, id); + this.selectedContainer.add(id); + } }, { key: '_onclickOptionsElement', value: function _onclickOptionsElement(e) { - var id = $(e.target).data("id"); - this.selectedEl.id = id; - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - - this.$buttonAddOptions.show(); - this.$optionsBox.hide(); - + // this.selectedEl.id = id; + // this.selectedEl.value = $(e.target).html(); + // this.$searchInput.val($(e.target).html()); + // + // this.$buttonAddOptions.show(); + // this.$optionsBox.hide(); + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), '_onclickOptionsElement', this).call(this, e); this.clear(); - this.selectedContainer.add(id); + // let id = $(e.target).data("id"); e.preventDefault(); return false; } @@ -1313,13 +1318,20 @@ $(this).find('.header').hide(); }); } + }, { + key: "setElementById", + value: function setElementById(id) { + var value = this.dataTree.getElementById(id).name; + this.selectedEl.id = id; + this.selectedEl.value = value; + this.$searchInput.val(value); + this.updateEditableContainer(id); + } }, { key: "_onclickOptionsElement", value: function _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - this.updateEditableContainer($(e.target).data("id")); + var id = $(e.target).data("id"); + this.setElementById(id); this.$buttonAddOptions.show(); this.$optionsBox.hide(); } diff --git a/assets/js/build/init_customer_project_create.js b/assets/js/build/init_customer_project_create.js index 4ba46b1..2801975 100644 --- a/assets/js/build/init_customer_project_create.js +++ b/assets/js/build/init_customer_project_create.js @@ -171,7 +171,12 @@ sb_realty_top.setHeader("Объект"); sb_realty_top.connectSelectedContainer(select_realty); sb_realty_top.dataPromise.then(function () { - if (!sb_realty_top.dataTree.data.length) sb_realty_top.hide(); + if (!sb_realty_top.dataTree.data.length) { + sb_realty_top.hide(); + } else { + var id = window.location.hash.replace("#", ""); + sb_realty_top.setElementById(id); + } }); select_realty.on("add", function (args) { //TODO: Костыли!!! @@ -922,19 +927,24 @@ this._fillOptionsData(); this._bindEvents(); } + }, { + key: 'setElementById', + value: function setElementById(id) { + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), 'setElementById', this).call(this, id); + this.selectedContainer.add(id); + } }, { key: '_onclickOptionsElement', value: function _onclickOptionsElement(e) { - var id = $(e.target).data("id"); - this.selectedEl.id = id; - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - - this.$buttonAddOptions.show(); - this.$optionsBox.hide(); - + // this.selectedEl.id = id; + // this.selectedEl.value = $(e.target).html(); + // this.$searchInput.val($(e.target).html()); + // + // this.$buttonAddOptions.show(); + // this.$optionsBox.hide(); + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), '_onclickOptionsElement', this).call(this, e); this.clear(); - this.selectedContainer.add(id); + // let id = $(e.target).data("id"); e.preventDefault(); return false; } @@ -1348,13 +1358,20 @@ $(this).find('.header').hide(); }); } + }, { + key: "setElementById", + value: function setElementById(id) { + var value = this.dataTree.getElementById(id).name; + this.selectedEl.id = id; + this.selectedEl.value = value; + this.$searchInput.val(value); + this.updateEditableContainer(id); + } }, { key: "_onclickOptionsElement", value: function _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - this.updateEditableContainer($(e.target).data("id")); + var id = $(e.target).data("id"); + this.setElementById(id); this.$buttonAddOptions.show(); this.$optionsBox.hide(); } diff --git a/assets/js/src/init_customer_project_create.js b/assets/js/src/init_customer_project_create.js index 3b94199..a4cfd7f 100644 --- a/assets/js/src/init_customer_project_create.js +++ b/assets/js/src/init_customer_project_create.js @@ -110,7 +110,12 @@ $(function () { sb_realty_top.setHeader("Объект"); sb_realty_top.connectSelectedContainer(select_realty); sb_realty_top.dataPromise.then(function () { - if (!sb_realty_top.dataTree.data.length) sb_realty_top.hide(); + if (!sb_realty_top.dataTree.data.length) { + sb_realty_top.hide() + }else{ + let id = window.location.hash.replace("#", ""); + sb_realty_top.setElementById(id); + } }); select_realty.on("add", (args)=> { //TODO: Костыли!!! diff --git a/assets/lib/proekton-components/js/src/NoTreeSelect.js b/assets/lib/proekton-components/js/src/NoTreeSelect.js index 69b4bb2..035af52 100644 --- a/assets/lib/proekton-components/js/src/NoTreeSelect.js +++ b/assets/lib/proekton-components/js/src/NoTreeSelect.js @@ -15,17 +15,14 @@ export default class NoTreeSelect extends AbsBaseSelect{ this._bindEvents(); } - _onclickOptionsElement(e) { - let id = $(e.target).data("id"); - this.selectedEl.id = id; - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - - this.$buttonAddOptions.show(); - this.$optionsBox.hide(); + setElementById(id) { + super.setElementById(id); + this.selectedContainer.add(id); + } + _onclickOptionsElement(e) { + super._onclickOptionsElement(e); this.clear(); - this.selectedContainer.add(id); e.preventDefault(); return false; } diff --git a/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js b/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js index 5d9937d..d1c830c 100644 --- a/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js +++ b/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js @@ -364,11 +364,17 @@ export default class AbsBaseSelect { }) } + setElementById(id) { + let value = this.dataTree.getElementById(id).name; + this.selectedEl.id = id; + this.selectedEl.value = value; + this.$searchInput.val(value); + this.updateEditableContainer(id); + } + _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - this.updateEditableContainer($(e.target).data("id")); + let id = $(e.target).data("id"); + this.setElementById(id); this.$buttonAddOptions.show(); this.$optionsBox.hide(); } diff --git a/assets/sass/components/custom-components.sass b/assets/sass/components/custom-components.sass index 873cd8a..ba9c82e 100644 --- a/assets/sass/components/custom-components.sass +++ b/assets/sass/components/custom-components.sass @@ -10,8 +10,9 @@ label font-weight: normal -li.active - border-top: 2px solid black +.nav + li.active + border-top: 3px solid black .simple-input height: 51px @@ -112,14 +113,13 @@ textarea.description -webkit-font-smoothing: antialiased .icon-edit - //padding-left: 30px //content: '' display: inline-block width: 40px - height: 20px + height: 16px background: image: url("#{$static}/img/menuUser.png") - //color: #00A66E + size: 60% repeat: no-repeat position: 0 0 diff --git a/projects/templates/customer_project_create.html b/projects/templates/customer_project_create.html index bc6e0a1..20438ab 100644 --- a/projects/templates/customer_project_create.html +++ b/projects/templates/customer_project_create.html @@ -56,6 +56,7 @@
| @@ -62,7 +62,7 @@ |
Отзывы:
|
- + | {{ reviews_p }} {{ reviews_n }} {{ reviews_m }} @@ -71,28 +71,32 @@ |