Show/hide UI to manage parent tab correctly on Firefox 40 and later #887

This commit is contained in:
Piro / YUKI Hiroshi 2015-08-19 01:12:07 +09:00
parent 289057ce55
commit dd2f17dd53

View File

@ -118,21 +118,16 @@ var TreeStyleTabBookmarksServiceEditable = inherit(TreeStyleTabBookmarksService,
document.getElementById('treestyletab-parent-label').setAttribute('value', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.label')); document.getElementById('treestyletab-parent-label').setAttribute('value', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.label'));
this.blankItem.setAttribute('label', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.blank.label')); this.blankItem.setAttribute('label', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.blank.label'));
TreeStyleTabUtils.doPatching(gEditItemOverlay._showHideRows, 'gEditItemOverlay._showHideRows', function(aName, aSource) {
return eval(aName+' = '+aSource.replace(
/(\}\)?)$/,
' TreeStyleTabBookmarksServiceEditable.parentRow.collapsed = this._element("keywordRow").collapsed && this._element("folderRow").collapsed;\n' +
'$1'
));
}, 'TreeStyleTab');
if (Services.vc.compare(Services.appinfo.platformVersion, '40') >= 0) { if (Services.vc.compare(Services.appinfo.platformVersion, '40') >= 0) {
// for Firefox 40 and later, after Bug 951651 // for Firefox 40 and later, after Bug 951651
TreeStyleTabUtils.doPatching(gEditItemOverlay.initPanel, 'gEditItemOverlay.initPanel', function(aName, aSource) { TreeStyleTabUtils.doPatching(gEditItemOverlay.initPanel, 'gEditItemOverlay.initPanel', function(aName, aSource) {
return eval(aName+' = '+aSource.replace( return eval(aName+' = '+aSource.replace(
'let showOrCollapse =', 'let showOrCollapse =',
'TreeStyleTabBookmarksServiceEditable.initParentMenuList(); $&' 'TreeStyleTabBookmarksServiceEditable.initParentMenuList(); $&'
).replace(
/(\}\)?)$/,
' TreeStyleTabBookmarksServiceEditable.parentRow.collapsed = this._element("keywordRow").collapsed && this._element("folderRow").collapsed;\n' +
'$1'
)); ));
}, 'TreeStyleTab'); }, 'TreeStyleTab');
} }
@ -144,6 +139,14 @@ var TreeStyleTabBookmarksServiceEditable = inherit(TreeStyleTabBookmarksService,
'$& TreeStyleTabBookmarksServiceEditable.initParentMenuList();' '$& TreeStyleTabBookmarksServiceEditable.initParentMenuList();'
)); ));
}, 'TreeStyleTab'); }, 'TreeStyleTab');
TreeStyleTabUtils.doPatching(gEditItemOverlay._showHideRows, 'gEditItemOverlay._showHideRows', function(aName, aSource) {
return eval(aName+' = '+aSource.replace(
/(\}\)?)$/,
' TreeStyleTabBookmarksServiceEditable.parentRow.collapsed = this._element("keywordRow").collapsed && this._element("folderRow").collapsed;\n' +
'$1'
));
}, 'TreeStyleTab');
} }
TreeStyleTabUtils.doPatching(gEditItemOverlay.onItemMoved, 'gEditItemOverlay.onItemMoved', function(aName, aSource) { TreeStyleTabUtils.doPatching(gEditItemOverlay.onItemMoved, 'gEditItemOverlay.onItemMoved', function(aName, aSource) {