mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
added orientation button to waveform...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
1fdcef47cb
commit
f0a6b5cb8f
@ -325,11 +325,15 @@ var igImageGraph_template = `
|
|||||||
float: right;
|
float: right;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
:host .controls button[disabled] {
|
||||||
|
opacity: 0.3;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
:host .controls button.current {
|
:host .controls button.current {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
:host .controls button:hover {
|
:host .controls button:hover:not([disabled]) {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -471,10 +475,33 @@ object.Constructor('igImageGraph', HTMLElement, {
|
|||||||
//button.innerHTML = '◑'
|
//button.innerHTML = '◑'
|
||||||
button.innerHTML = '◪'
|
button.innerHTML = '◪'
|
||||||
button.onclick = function(){
|
button.onclick = function(){
|
||||||
that.graph = that.graph == 'waveform' ?
|
var g = that.graph = that.graph == 'waveform' ?
|
||||||
'histogram'
|
'histogram'
|
||||||
: 'waveform'
|
: 'waveform'
|
||||||
that.update() }
|
var b = button.parentElement.querySelector('#orientation-button') || {}
|
||||||
|
b.disabled = that.graph != 'waveform'
|
||||||
|
}
|
||||||
|
return button }(),
|
||||||
|
// orientation...
|
||||||
|
function(){
|
||||||
|
var button = document.createElement('button')
|
||||||
|
button.setAttribute('id', 'orientation-button')
|
||||||
|
button.classList.add('update')
|
||||||
|
//button.innerHTML = '▥'
|
||||||
|
button.innerHTML = '↕'
|
||||||
|
button.disabled = that.graph != 'waveform'
|
||||||
|
var o = that.orientation || 0
|
||||||
|
button.onclick = function(){
|
||||||
|
var n = that.orientation =
|
||||||
|
that.orientation == 0 ?
|
||||||
|
90
|
||||||
|
: that.orientation == 180 ?
|
||||||
|
270
|
||||||
|
: that.orientation == 270 ?
|
||||||
|
180
|
||||||
|
: 0
|
||||||
|
this.style.transform = 'rotate('+(o == n ? 0 : -90)+'deg)'
|
||||||
|
}
|
||||||
return button }(),
|
return button }(),
|
||||||
// modes...
|
// modes...
|
||||||
(this.nocontrols ?
|
(this.nocontrols ?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user