bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-05-20 05:28:19 +03:00
parent 5cee39ed70
commit d3511f1f82
4 changed files with 22 additions and 3 deletions

View File

@ -1559,6 +1559,8 @@ module.CropActions = actions.Actions({
// XXX not sure if we actually need this...
cropFlatten: ['Crop/Flatten',
{browseMode: function(){
return this.data.ribbon_order.length <= 1 && 'disabled' }},
function(list){ this.data.length > 0 && this.crop(list, true) }],
cropRibbon: ['Crop/Crop ribbon',
function(ribbon, flatten){

View File

@ -213,7 +213,8 @@ var ImageMarkActions = actions.Actions({
|| !('selected' in this.data.tags)){
return []
}
return this.data.tags['selected'].slice()
//return this.data.tags['selected'].slice()
return this.data.getImages(this.data.tags['selected'])
},
markedInRibbon: ['- Mark|Ribbon/',
@ -232,6 +233,8 @@ var ImageMarkActions = actions.Actions({
function(mode){ this.nextTagged('selected', mode) }],
cropMarked: ['Mark|Crop/Crop $marked images',
{browseMode: function(target){
return this.marked.length == 0 && 'disabled' }},
function(flatten){ this.cropTagged('selected', 'any', flatten) }],
})
@ -402,7 +405,8 @@ var ImageBookmarkActions = actions.Actions({
|| !('bookmark' in this.data.tags)){
return []
}
return this.data.tags['bookmark'].slice()
//return this.data.tags['bookmark'].slice()
return this.data.getImages(this.data.tags['bookmark'])
},
prevBookmarked: ['Bookmark|Navigate/Previous bookmarked image',
@ -411,6 +415,8 @@ var ImageBookmarkActions = actions.Actions({
function(mode){ this.nextTagged('bookmark', mode) }],
cropBookmarked: ['Bookmark|Crop/Crop $bookmarked images',
{browseMode: function(target){
return this.bookmarked.length == 0 && 'disabled' }},
function(flatten){ this.cropTagged('bookmark', 'any', flatten) }],
})

View File

@ -1548,6 +1548,10 @@ var WidgetTestActions = actions.Actions({
return function(){
console.log('<<<', [].slice.call(arguments)) }}],
testActionDisabled: ['Test/$Disabled test action',
{browseMode: function(){ return 'disabled' }},
function(){}],
// Usage Examples:
// .testDrawer() - show html in base drawer...
// .testDrawer('Header', 'paragraph') - show html with custom text...

View File

@ -2982,6 +2982,7 @@ var BrowserPrototype = {
// NOTE: 'none' will always return an empty jQuery object, to get
// the selection state before deselecting use .select('!')
// NOTE: this uses .filter(..) for string and regexp matching...
// NOTE: this will not select disabled elements (XXX)
select: function(elem, filtering){
var browser = this.dom
var pattern = '.list .item'
@ -3037,6 +3038,11 @@ var BrowserPrototype = {
browser.find('.path .dir.cur').text(elem.find('.text').text())
}
// XXX not sure if this is correct...
if(elem.hasClass('disabled')){
return $()
}
// handle scroll position...
var p = elem.scrollParent()
var S = p.scrollTop()
@ -3455,7 +3461,8 @@ var BrowserPrototype = {
// if text is empty, skip action...
if(txt != ''){
path.push(elem.find('.text').text())
//path.push(elem.find('.text').text())
path.push(txt)
var res = this.open(path)
}