fixed a bug with List.options.data contaminated when toggling showDisabled...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-01-17 08:25:03 +03:00
parent f819acfa94
commit 9d632201e4
3 changed files with 21 additions and 7 deletions

View File

@ -225,12 +225,9 @@ var MetadataUIActions = actions.Actions({
// XXX should we replace 'mode' with nested set of metadata???
// XXX make this support multiple images...
// XXX BUG: with mode 'disabled' key D enables elements but does not
// hide them...
showMetadata: ['Image/Show metadata',
function(image, mode){
image = this.data.getImage(image)
//mode = mode || 'short'
mode = mode || 'disabled'
var field_order = this.config['metadata-field-order'] || []
@ -276,7 +273,10 @@ var MetadataUIActions = actions.Actions({
var o = overlay.Overlay(this.ribbons.viewer,
browse.makeList(
null,
fields)
fields,
{
showDisabled: false,
})
// path selected...
.open(function(evt, path){
// edit field...
@ -288,6 +288,7 @@ var MetadataUIActions = actions.Actions({
*/
}))
.close(function(){
// XXX
})
o.client.dom.addClass('metadata-view')

View File

@ -348,8 +348,7 @@ var URLHistoryUIActions = actions.Actions({
// - [ 'open', 'close' ] - explicitly select event
'url-history-list-clear': ['open', 'close'],
},
// XXX BUG: when running from action menu this breaks...
// ...possibly connected with restoring after .preventClosing(..)
// XXX make availabilyty checking live (now on open dialog)...
// XXX need to check items...
// XXX use svg icons for buttons...
listURLHistory: ['History|File/Show history',
@ -375,7 +374,15 @@ var URLHistoryUIActions = actions.Actions({
var o = overlay.Overlay(this.ribbons.viewer,
browse.makeList(
null,
Object.keys(this.url_history).reverse(),
Object.keys(this.url_history)
.reverse()
// NOTE: this might get a little slow for
// very large sets...
.map(function(p){
return !that.checkURLFromHistory(p) ?
'- ' + p
: p
}),
{
// add item buttons...
itemButtons: [
@ -433,9 +440,11 @@ var URLHistoryUIActions = actions.Actions({
var list = o.client
/*
Object.keys(this.url_history).reverse().forEach(function(p){
that.checkURLFromHistory(p) || list.filter(p).addClass('disabled')
})
*/
// select and highlight current path...
cur && list

View File

@ -2107,7 +2107,11 @@ ListPrototype.options = {
if(typeof(k) == typeof('str')){
n = tt
} else {
// NOTE: here we want to avoid .data contamination
// so we'll make a copy...
n = n.slice()
n[0] = tt
}