mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 03:40:09 +00:00
cleanup, rafatoring and minor fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5f7e89409c
commit
b51448a78c
22
ui/ui.js
22
ui/ui.js
@ -579,31 +579,27 @@ var FIELD_TYPES = {
|
|||||||
t = t == '' ? Math.random()+'' : t
|
t = t == '' ? Math.random()+'' : t
|
||||||
var item = field.find('.item').last()
|
var item = field.find('.item').last()
|
||||||
for(var i=0; i < value.length; i++){
|
for(var i=0; i < value.length; i++){
|
||||||
var txt = value[i]
|
|
||||||
|
|
||||||
// get options...
|
// get options...
|
||||||
var opts = txt.split(/\|/g)
|
var opts = value[i]
|
||||||
txt = opts[0].trim()
|
.split(/\|/g)
|
||||||
opts = opts
|
|
||||||
.slice(1)
|
|
||||||
.map(function(e){ return e.trim() })
|
.map(function(e){ return e.trim() })
|
||||||
|
|
||||||
var val = item.find('.value')
|
var val = item.find('.value')
|
||||||
val.val(txt)
|
val.val(opts[0])
|
||||||
|
|
||||||
// set checked state...
|
// set checked state...
|
||||||
if(opts.indexOf('default') >= 0){
|
if(opts.slice(1).indexOf('default') >= 0){
|
||||||
val.prop('checked', true)
|
val.prop('checked', true)
|
||||||
opts.splice(opts.indexOf('default'), 1)
|
opts.splice(opts.indexOf('default'), 1)
|
||||||
} else {
|
} else {
|
||||||
val.prop('checked', false)
|
val.prop('checked', false)
|
||||||
}
|
}
|
||||||
|
|
||||||
txt = item.find('.item-text')
|
var txt = item.find('.item-text')
|
||||||
.html(txt)
|
.html(opts[0])
|
||||||
|
|
||||||
// tooltip...
|
// tooltip...
|
||||||
if(opts.length > 0){
|
if(opts.length > 1){
|
||||||
$('<span class="tooltip-icon tooltip-right"> *</span>')
|
$('<span class="tooltip-icon tooltip-right"> *</span>')
|
||||||
.attr('tooltip', opts.pop())
|
.attr('tooltip', opts.pop())
|
||||||
.appendTo(txt)
|
.appendTo(txt)
|
||||||
@ -834,6 +830,9 @@ function formDialog(root, message, config, btn, cls){
|
|||||||
// NOTE: if first element is a radio button set, focus the checked
|
// NOTE: if first element is a radio button set, focus the checked
|
||||||
// element, else focus the first input...
|
// element, else focus the first input...
|
||||||
form.ready(function(){
|
form.ready(function(){
|
||||||
|
// NOTE: we are using a timeout to avoid the user input that opened
|
||||||
|
// the dialog to end up in the first field...
|
||||||
|
setTimeout(function(){
|
||||||
var elem = form.find('.field input').first()
|
var elem = form.find('.field input').first()
|
||||||
if(elem.attr('type') == 'radio'){
|
if(elem.attr('type') == 'radio'){
|
||||||
form.find('.field input:checked')
|
form.find('.field input:checked')
|
||||||
@ -844,6 +843,7 @@ function formDialog(root, message, config, btn, cls){
|
|||||||
.focus()
|
.focus()
|
||||||
.select()
|
.select()
|
||||||
}
|
}
|
||||||
|
}, 100)
|
||||||
})
|
})
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
@ -137,7 +137,9 @@ function recentlyOpenedDialog(){
|
|||||||
updateStatus('Recently opened...').show()
|
updateStatus('Recently opened...').show()
|
||||||
|
|
||||||
var dict = {}
|
var dict = {}
|
||||||
var title = '<b>Recently opened:</b>'
|
var title = '<b>Recently opened:</b> | '+
|
||||||
|
'Shortcuts ctrl-shift-Left and ctrl-shift-Right can be used\n'+
|
||||||
|
'to move through this list from ribbon view.'
|
||||||
|
|
||||||
var cfg = {}
|
var cfg = {}
|
||||||
cfg[title] = BASE_URL_HISTORY.map(function(e){
|
cfg[title] = BASE_URL_HISTORY.map(function(e){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user