From ea8209c1f4867639c760a6cef4f7f85ffd7eaece Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 27 Feb 2019 03:35:03 +0300 Subject: [PATCH] preparing to add default elements... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index f96b540f..f1c848da 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -544,6 +544,7 @@ var BaseBrowserPrototype = { splice: function(){}, + // Events... // // Format: // { @@ -563,6 +564,8 @@ var BaseBrowserPrototype = { // XXX should these be defined on this level or should we use DOM??? // XXX add support for item events... // e.g. item.focus(..) -> root.focus(..) + // XXX also need to design a means for this system to interact both + // ways with DOM events... on: function(evt, handler){ var handlers = this.__event_handlers = this.__event_handlers || {} handlers = handlers[evt] = handlers[evt] || [] @@ -702,6 +705,33 @@ var BrowserPrototype = { // XXX need to mix these into the header only... headerItemButtons: [ ], + + // Shorthand elements... + // + // Format: + // { + // : { + // class: , + // html: , + // }, + // ... + // } + // + // If make(..) gets passed it will construct and element + // via with an optional + // + // NOTE: .class is optional... + // NOTE: set this to null to disable shorthands... + elementShorthand: { + '---': { + 'class': 'separator', + 'html': '
' + }, + '...': { + 'class': 'separator', + 'html': '
', + }, + }, }, // parent element (optional)... @@ -899,6 +929,10 @@ var BrowserPrototype = { if(options.hidden && !options.renderHidden){ return null } + + // XXX handle special items... + // XXX + var text = JSON.stringify(item.value) var elem = document.createElement('div')