From 8149fcf41a894c916f7e4a967c5561a117ab9ee2 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 17 May 2020 18:59:20 +0300 Subject: [PATCH] settings and minor tweaking... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/metadata.js | 10 +++++++--- ui (gen4)/lib/components/ig-image-graph.js | 21 +++++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ui (gen4)/features/metadata.js b/ui (gen4)/features/metadata.js index bbc12b0a..8ee6c8b5 100755 --- a/ui (gen4)/features/metadata.js +++ b/ui (gen4)/features/metadata.js @@ -340,7 +340,7 @@ var MetadataUIActions = actions.Actions({ ], // XXX EXPERIMENTAL: graph... - 'metadata-graph': true, + 'metadata-graph': 'on', 'metadata-graph-config': { graph: 'waveform', mode: 'luminance', @@ -351,6 +351,10 @@ var MetadataUIActions = actions.Actions({ core.makeConfigToggler('metadata-auto-select-mode', function(){ return this.config['metadata-auto-select-modes'] })], + toggleMetadataGraph: ['Interface/Metadata graph display', + { browseMode: function(){ return !graph && 'hidden' }, }, + core.makeConfigToggler('metadata-graph', ['on', 'off'])], + // NOTE: this will extend the Browse object with .updateMetadata(..) // method to enable updating of metadata in the list... // @@ -409,7 +413,7 @@ var MetadataUIActions = actions.Actions({ delete this.__graph_updating }.bind(this), 200) // graph disabled... - if(!graph || !that.config['metadata-graph']){ + if(!graph || that.config['metadata-graph'] != 'on'){ return } // data... @@ -451,7 +455,7 @@ var MetadataUIActions = actions.Actions({ // XXX EXPERIMENTAL: graph // graph... graph - && that.config['metadata-graph'] + && that.config['metadata-graph'] == 'on' && make(['Graph:', $(this.updateGraph())], { cls: 'preview' }) // NOTE: these are 1-based and not 0-based... diff --git a/ui (gen4)/lib/components/ig-image-graph.js b/ui (gen4)/lib/components/ig-image-graph.js index b6a94d62..8c88cc8e 100644 --- a/ui (gen4)/lib/components/ig-image-graph.js +++ b/ui (gen4)/lib/components/ig-image-graph.js @@ -488,10 +488,20 @@ object.Constructor('igImageGraph', HTMLElement, { button.setAttribute('id', 'orientation-button') button.classList.add('update') button.innerHTML = '🡑' - button.style.marginTop = '-2px' - //button.innerHTML = '↕' + // load button state... + var _update = function(){ + Object.assign(button.style, + !that.__rotated ? + { + transform: '', + marginTop: '-2px', + } + : { + transform: 'rotate(90deg)', + marginTop: '-1px', + }) } + _update() button.disabled = that.graph != 'waveform' - var o = that.orientation || 0 button.onclick = function(){ var n = that.orientation = that.orientation == 0 ? @@ -501,9 +511,8 @@ object.Constructor('igImageGraph', HTMLElement, { : that.orientation == 270 ? 180 : 0 - // update button orientation... - this.style.transform = 'rotate('+(o == n ? 0 : 90)+'deg)' - this.style.marginTop = o == n ? '-2px' : '-1px' + var r = that.__rotated = !that.__rotated + _update() } return button }(), // modes...