From 184b86e0decda323e53f43447306b047060883f4 Mon Sep 17 00:00:00 2001 From: booblegum Date: Tue, 6 Dec 2016 12:03:52 +0300 Subject: [PATCH] =?UTF-8?q?PR-41=20=D0=A4=D0=BE=D1=80=D0=BC=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D0=B0=20=D0=97=D0=B0=D0=BA=D0=B0=D0=B7=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Косметические правки и мелкие доработки --- .../js/build/init_customer_project_create.js | 19 ++++++++++++------- assets/js/src/init_customer_project_create.js | 9 ++++++--- .../js/src/NoTreeSelect.js | 5 +++-- assets/sass/main.sass | 10 ++++++++-- .../templates/customer_project_create.html | 2 +- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/assets/js/build/init_customer_project_create.js b/assets/js/build/init_customer_project_create.js index 774a759..640963b 100644 --- a/assets/js/build/init_customer_project_create.js +++ b/assets/js/build/init_customer_project_create.js @@ -167,19 +167,26 @@ $realty.hide(); } }); - var sb_realty_top = new _NoTreeSelect2.default($('#sb-realty-top'), { url: url, visible: false }); + var sb_realty_top = new _NoTreeSelect2.default($('#sb-realty-top'), { url: url, visible: true }); 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(); + }); select_realty.on("add", function (args) { // console.log("add args = ", args); + console.log('on add'); //TODO: Костыли!!! + $('#checkbox-sb-realty').prop("checked", true); + sb_realty.show(); var id = args[0]; if (id.text) return; + console.log("id = ", id); var el = sb_realty.dataTree.getElementById(id); sb_realty_top.$searchInput.val(el.name); sb_realty_top.selectedEl.id = id; sb_realty_top.selectedEl.value = el.name; - sb_realty_top.show(); + // sb_realty_top.show(); sb_realty.selectedEl.id = id; sb_realty._fillBoxes(); }); @@ -705,9 +712,6 @@ binds.push(arg); args.splice(args.indexOf(arg), 1); } - // else { - // console.log("arg = ", arg); - // } } } catch (err) { _didIteratorError = true; @@ -915,15 +919,16 @@ }, { key: '_onclickOptionsElement', value: function _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); + 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.selectedContainer.add(this.selectedEl.id); this.clear(); + this.selectedContainer.add(id); e.preventDefault(); return false; } diff --git a/assets/js/src/init_customer_project_create.js b/assets/js/src/init_customer_project_create.js index d61e6eb..c95dd61 100644 --- a/assets/js/src/init_customer_project_create.js +++ b/assets/js/src/init_customer_project_create.js @@ -106,19 +106,22 @@ $(function () { } } ); - let sb_realty_top = new NoTreeSelect($('#sb-realty-top'), {url, visible: false}); + let sb_realty_top = new NoTreeSelect($('#sb-realty-top'), {url, visible: true}); 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(); + }); select_realty.on("add", (args)=> { - // console.log("add args = ", args); //TODO: Костыли!!! + $('#checkbox-sb-realty').prop("checked", true); + sb_realty.show(); let id = args[0]; if (id.text) return; let el = sb_realty.dataTree.getElementById(id); sb_realty_top.$searchInput.val(el.name); sb_realty_top.selectedEl.id = id; sb_realty_top.selectedEl.value = el.name; - sb_realty_top.show(); sb_realty.selectedEl.id = id; sb_realty._fillBoxes(); }) diff --git a/assets/lib/proekton-components/js/src/NoTreeSelect.js b/assets/lib/proekton-components/js/src/NoTreeSelect.js index d1a3baf..69b4bb2 100644 --- a/assets/lib/proekton-components/js/src/NoTreeSelect.js +++ b/assets/lib/proekton-components/js/src/NoTreeSelect.js @@ -16,15 +16,16 @@ export default class NoTreeSelect extends AbsBaseSelect{ } _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); + 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(); - this.selectedContainer.add(this.selectedEl.id); this.clear(); + this.selectedContainer.add(id); e.preventDefault(); return false; } diff --git a/assets/sass/main.sass b/assets/sass/main.sass index 72d7772..bbd97df 100644 --- a/assets/sass/main.sass +++ b/assets/sass/main.sass @@ -9,7 +9,7 @@ body .main-scope > .row border-right: 1px solid #{map_get($component_colors, border)} - border-left: 1px solid #{map_get($component_colors, border)} + border-left: 1px solid #{map_get($component_colors, border)} .main-content padding: 43px 25px 40px 25px @@ -63,4 +63,10 @@ body border-bottom: 1px solid #{map_get($component_colors, border)} .select-text - color: #{map_get($component_colors, select)} \ No newline at end of file + color: #{map_get($component_colors, select)} + +.slide + display: none + +.slide.active + display: block diff --git a/projects/templates/customer_project_create.html b/projects/templates/customer_project_create.html index 6de3c5d..3c31375 100644 --- a/projects/templates/customer_project_create.html +++ b/projects/templates/customer_project_create.html @@ -134,7 +134,7 @@ -
+
Способ оплаты