settings and minor tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-05-17 18:59:20 +03:00
parent 1427a327eb
commit 8149fcf41a
2 changed files with 22 additions and 9 deletions

View File

@ -340,7 +340,7 @@ var MetadataUIActions = actions.Actions({
], ],
// XXX EXPERIMENTAL: graph... // XXX EXPERIMENTAL: graph...
'metadata-graph': true, 'metadata-graph': 'on',
'metadata-graph-config': { 'metadata-graph-config': {
graph: 'waveform', graph: 'waveform',
mode: 'luminance', mode: 'luminance',
@ -351,6 +351,10 @@ var MetadataUIActions = actions.Actions({
core.makeConfigToggler('metadata-auto-select-mode', core.makeConfigToggler('metadata-auto-select-mode',
function(){ return this.config['metadata-auto-select-modes'] })], 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(..) // NOTE: this will extend the Browse object with .updateMetadata(..)
// method to enable updating of metadata in the list... // method to enable updating of metadata in the list...
// //
@ -409,7 +413,7 @@ var MetadataUIActions = actions.Actions({
delete this.__graph_updating }.bind(this), 200) delete this.__graph_updating }.bind(this), 200)
// graph disabled... // graph disabled...
if(!graph || !that.config['metadata-graph']){ if(!graph || that.config['metadata-graph'] != 'on'){
return } return }
// data... // data...
@ -451,7 +455,7 @@ var MetadataUIActions = actions.Actions({
// XXX EXPERIMENTAL: graph // XXX EXPERIMENTAL: graph
// graph... // graph...
graph graph
&& that.config['metadata-graph'] && that.config['metadata-graph'] == 'on'
&& make(['Graph:', $(this.updateGraph())], && make(['Graph:', $(this.updateGraph())],
{ cls: 'preview' }) { cls: 'preview' })
// NOTE: these are 1-based and not 0-based... // NOTE: these are 1-based and not 0-based...

View File

@ -488,10 +488,20 @@ object.Constructor('igImageGraph', HTMLElement, {
button.setAttribute('id', 'orientation-button') button.setAttribute('id', 'orientation-button')
button.classList.add('update') button.classList.add('update')
button.innerHTML = '&#129105;' button.innerHTML = '&#129105;'
button.style.marginTop = '-2px' // load button state...
//button.innerHTML = '&#8597;' var _update = function(){
Object.assign(button.style,
!that.__rotated ?
{
transform: '',
marginTop: '-2px',
}
: {
transform: 'rotate(90deg)',
marginTop: '-1px',
}) }
_update()
button.disabled = that.graph != 'waveform' button.disabled = that.graph != 'waveform'
var o = that.orientation || 0
button.onclick = function(){ button.onclick = function(){
var n = that.orientation = var n = that.orientation =
that.orientation == 0 ? that.orientation == 0 ?
@ -501,9 +511,8 @@ object.Constructor('igImageGraph', HTMLElement, {
: that.orientation == 270 ? : that.orientation == 270 ?
180 180
: 0 : 0
// update button orientation... var r = that.__rotated = !that.__rotated
this.style.transform = 'rotate('+(o == n ? 0 : 90)+'deg)' _update()
this.style.marginTop = o == n ? '-2px' : '-1px'
} }
return button }(), return button }(),
// modes... // modes...