diff --git a/forms/account/address-list/address-list.js b/forms/account/address-list/address-list.js index 22e8cfbd..74f7ed81 100644 --- a/forms/account/address-list/address-list.js +++ b/forms/account/address-list/address-list.js @@ -22,12 +22,12 @@ Hedera.AddressList = new Class window.history.back(); } - ,onRemoveAddressClick: function (button, form) + ,onRemoveAddressClick: function (button) { if (confirm (_('AreYouSureDeleteAddress'))) { - form.set ('active', false); - form.refresh (); + button.lot.set ('active', false); + button.lot.refresh (); } } }); diff --git a/forms/account/address-list/ui.xml b/forms/account/address-list/ui.xml index 8b60520e..92681601 100755 --- a/forms/account/address-list/ui.xml +++ b/forms/account/address-list/ui.xml @@ -30,7 +30,7 @@ id="default-address" lot="user-form" name="default_address"/> - +
row.available) newAmount = row.available; - this.items[row.warehouse] = newAmount; + this.items[row.warehouse_id] = newAmount; this.$.amount.value += newAmount - lotAmount; } else @@ -279,11 +280,11 @@ Hedera.Catalog = new Class amountSum += amount; var params = { - item: this.$.cardItem.value, - warehouse: warehouse, + item: this.$.cardLot.$.item, + warehouse: parseInt (warehouse), amount: amount }; - sql += this.conn.render (query, params); + sql += this.conn.renderQuery (query, params); } if (amountSum > 0) @@ -292,7 +293,7 @@ Hedera.Catalog = new Class var itemName = this.$.card.$.Article; Htk.Toast.showMessage ( - sprintf (_('Added%dOf%s'), amountSum, itemName)); + Vn.Value.sprintf (_('Added%dOf%s'), amountSum, itemName)); } this.$.cardPopup.hide (); @@ -308,12 +309,7 @@ Hedera.Catalog = new Class { this.onEraseClick (); this.$.card.row = -1; - this.$.cardItem.value = undefined; - } - - ,onStatusChange: function () - { - this.$.cardPopup.reset (); + this.$.cardLot.assign ({item: undefined}); } }); diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index 0459ce51..4abf7936 100755 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -78,8 +78,7 @@ + lot="card-lot"> SELECT a.description, o.str origin FROM vn2008.Articles a LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen @@ -89,8 +88,7 @@ + lot="card-lot"> CALL bionic_from_item (#item); SELECT p.warehouse_id, w.name warehouse, p.grouping, p.price, p.rate, l.available FROM tmp.bionic_lot l @@ -137,10 +135,11 @@ full-dir="900x900"/>

{{item.Article}}

diff --git a/forms/ecomerce/invoices/invoices.js b/forms/ecomerce/invoices/invoices.js index 00cb501e..bcd66202 100644 --- a/forms/ecomerce/invoices/invoices.js +++ b/forms/ecomerce/invoices/invoices.js @@ -22,9 +22,9 @@ Hedera.Invoices = new Class return; var params = { - 'srv': 'rest:dms/invoice' - ,'invoice': invoiceId - ,'token': this.conn.token + srv: 'rest:dms/invoice' + ,invoice: invoiceId + ,token: this.conn.token }; var url = '?'+ Vn.Url.makeUri (params); diff --git a/js/db/result.js b/js/db/result.js index 139ad096..8b9f9d4e 100644 --- a/js/db/result.js +++ b/js/db/result.js @@ -10,7 +10,7 @@ module.exports = new Class { Object.assign (this, { data: result.data, - result: result.tables, + tables: result.tables, columns: result.columns, row: -1 }); diff --git a/js/htk/assistant-bar.js b/js/htk/assistant-bar.js index 4ca0ef54..423c53b8 100644 --- a/js/htk/assistant-bar.js +++ b/js/htk/assistant-bar.js @@ -45,23 +45,29 @@ module.exports = new Class var bar = this.createRoot ('div'); bar.className = 'htk-assistant-bar'; - var previousButton = this.createElement ('img'); - previousButton.src = 'image/icon/light/go-previous.svg'; + var previousButton = this.createElement ('button'); previousButton.className = 'previous'; previousButton.title = _('Previous'); previousButton.addEventListener ('click', this.movePrevious.bind (this)); bar.appendChild (previousButton); + + var icon = this.createElement ('htk-icon'); + icon.icon = 'go-previous'; + previousButton.appendChild (icon.node); var steps = this.createElement ('div'); bar.appendChild (steps); - var nextButton = this.createElement ('img'); - nextButton.src = 'image/icon/light/go-next.svg'; + var nextButton = this.createElement ('button'); nextButton.className = 'next'; nextButton.title = _('Next'); nextButton.addEventListener ('click', this.moveNext.bind (this)); bar.appendChild (nextButton); + var icon = this.createElement ('htk-icon'); + icon.icon = 'go-next'; + nextButton.appendChild (icon.node); + this._steps = steps; this._previousButton = previousButton; this._nextButton = nextButton; diff --git a/js/htk/assistant.js b/js/htk/assistant.js index 40dec273..a5cae972 100644 --- a/js/htk/assistant.js +++ b/js/htk/assistant.js @@ -48,15 +48,7 @@ module.exports = new Class { return this._stepFunc; } - }, - node: - { - type: Object - ,set: function (x) - { - x.className = 'htk-assistant'; - } - }, + } } ,_steps: [] diff --git a/js/htk/field/button.js b/js/htk/field/button.js index 033952b3..fad4aaae 100644 --- a/js/htk/field/button.js +++ b/js/htk/field/button.js @@ -10,15 +10,25 @@ module.exports = new Class type: String ,set: function (x) { + this._image = x; this.img.src = x; } + ,get: function () + { + return this._image; + } }, icon: { type: String ,set: function (x) { - this.img.src = 'image/icon/light/'+ x +'.svg'; + this._icon = x; + this.image = 'image/icon/light/'+ x +'.svg'; + } + ,get: function () + { + return this._icon; } }, tip: @@ -26,17 +36,15 @@ module.exports = new Class type: String ,set: function (x) { - if (x) - { - this.node.title = _(x); - this.img.title = _(x); - } - + this._tip = x; + x = x ? x : ''; + this.node.title = x; + this.img.title = x; this.renderContent (); } ,get: function () { - return this.node.title; + return this._tip; } }, showText: @@ -55,6 +63,9 @@ module.exports = new Class } ,_showText: false + ,_tip: null + ,_image: null + ,_icon: null ,render: function () { diff --git a/js/htk/field/calendar.js b/js/htk/field/calendar.js index c7eef3f4..5702a9b3 100644 --- a/js/htk/field/calendar.js +++ b/js/htk/field/calendar.js @@ -37,12 +37,16 @@ module.exports = new Class div.className = 'month'; node.appendChild (div); - var button = this.createElement ('div'); - button.appendChild (this.createTextNode ('<')); - button.className = 'button previous'; + var button = this.createElement ('button'); + button.className = 'previous'; button.addEventListener ('click', this.prevMonthClicked.bind (this)); div.appendChild (button); + var icon = this.createElement ('htk-icon'); + icon.icon = 'go-previous', + icon.theme = 'dark'; + button.appendChild (icon.node); + var monthNode = this.createElement ('span'); div.appendChild (monthNode); @@ -52,12 +56,16 @@ module.exports = new Class var yearNode = this.createElement ('span'); div.appendChild (yearNode); - var button = this.createElement ('div'); - button.appendChild (this.createTextNode ('>')); - button.className = 'button next'; + var button = this.createElement ('button'); + button.className = 'next'; button.addEventListener ('click', this.nextMonthClicked.bind (this)); div.appendChild (button); + var icon = this.createElement ('htk-icon'); + icon.icon = 'go-next', + icon.theme = 'dark'; + button.appendChild (icon.node); + var wrapper = this.createElement ('div'); wrapper.className = 'wrapper'; node.appendChild (wrapper); diff --git a/js/htk/icon.js b/js/htk/icon.js index f93d2668..3bfe3a43 100644 --- a/js/htk/icon.js +++ b/js/htk/icon.js @@ -50,7 +50,8 @@ module.exports = new Class ,render: function () { - this.createRoot ('img'); + var node = this.createRoot ('img'); + node.className = 'htk-icon'; } ,_setIcon: function () diff --git a/js/htk/style.css b/js/htk/style.css index 92dede95..f7b50dc4 100644 --- a/js/htk/style.css +++ b/js/htk/style.css @@ -215,23 +215,19 @@ td.cell-image .htk-image line-height: 2.2em; font-size: 1.4em; } -.htk-calendar .month > .button +.htk-calendar .month > button { - cursor: pointer; height: 2.2em; width: 2.2em; text-align: center; border-radius: 50%; + margin: 0; } -.htk-calendar .month > .button:hover -{ - background-color: rgba(1, 1, 1, 0.2); -} -.htk-calendar .month > .button.previous +.htk-calendar .month > button.previous { float:left; } -.htk-calendar .month > .button.next +.htk-calendar .month > button.next { float:right; } @@ -548,29 +544,31 @@ td.cell-image .htk-image { cursor: pointer; } -.htk-assistant-bar > img +.htk-assistant-bar > button { position: absolute; - width: 1.8em; + width: 2.5em; + height: 2.5em; top: 0; padding: .3em; - border-radius: 0.1em; margin: -0.3 0; + border-radius: 50%; } -.htk-assistant-bar > img:hover +.htk-assistant-bar > button > .htk-icon { - background-color: rgba(1,1,1,0.1); + width: 100%; + height: 100%; } -.htk-assistant-bar > img.previous, -.htk-assistant-bar > img.next +.htk-assistant-bar > button.previous, +.htk-assistant-bar > button.next { margin: -0.3em; } -.htk-assistant-bar > img.previous +.htk-assistant-bar > button.previous { left: 0; } -.htk-assistant-bar > img.next +.htk-assistant-bar > button.next { right: 0; } diff --git a/js/vn/component.js b/js/vn/component.js index 81416b17..f41ac239 100644 --- a/js/vn/component.js +++ b/js/vn/component.js @@ -7,7 +7,8 @@ var nativeEvents = { ,focusout : 1 }; -module.exports = new Class +var Klass = new Class (); +module.exports = Klass.implement ({ Extends: NodeBuilder ,Properties: @@ -27,12 +28,12 @@ module.exports = new Class /** * CSS classes to be appendend to the node classes. */ - class: + className: { type: String ,set: function (x) { - this._cssClass = x; + this._className = x; this._refreshClass (); } ,get: function () @@ -40,6 +41,18 @@ module.exports = new Class return this._node.className; } }, + /** + * CSS classes to be appendend to the node classes. + */ + class: + { + type: String + ,set: function (x) + { + this._className = x; + this._refreshClass (); + } + }, /** * The HTML id of the element. */ @@ -70,6 +83,19 @@ module.exports = new Class this.renderBase (); this.parent (props); } + + ,appendChild: function (child) + { + if (child instanceof Klass) + this._node.appendChild (child.node); + else if (child instanceof Element) + this._node.appendChild (child); + } + + ,addEventListener: function (eventName, callback) + { + this.node.addEventListener (eventName, callback); + } ,on: function (id, callback, instance) { @@ -101,8 +127,8 @@ module.exports = new Class ,_refreshClass: function () { - if (this._node && this._cssClass) - this._node.className = this._cssClass +' '+ this._node.className; + if (this._node && this._className) + this._node.className = this._className +' '+ this._node.className; } ,remove: function () diff --git a/js/vn/node-builder.js b/js/vn/node-builder.js index 2f7e0955..4da3c230 100644 --- a/js/vn/node-builder.js +++ b/js/vn/node-builder.js @@ -4,6 +4,20 @@ var VnObject = require ('./object'); module.exports = new Class ({ Extends: VnObject + ,Properties: + { + /** + * The owner document. + */ + ownerDocument: + { + type: Object + ,get: function () + { + return this.doc; + } + } + } ,doc: null @@ -15,7 +29,12 @@ module.exports = new Class ,createElement: function (tagName) { - return document.createElement (tagName); + var customTag = vnCustomTags[tagName]; + + if (customTag !== undefined) + return new customTag ({doc: this.doc}); + else + return document.createElement (tagName); } ,createTextNode: function (text) diff --git a/js/vn/transitions.js b/js/vn/transitions.js index b5aa42a4..35d80fc9 100644 --- a/js/vn/transitions.js +++ b/js/vn/transitions.js @@ -29,7 +29,6 @@ function checkTransitions () return null; } -checkTransitions (); /** * Slides an element.