minor code review

This commit is contained in:
gorhill 2015-10-17 18:30:59 -04:00
parent a19f5701ef
commit 88dac6d4a1
1 changed files with 3 additions and 5 deletions

View File

@ -2433,7 +2433,6 @@ vAPI.toolbarButton = {
};
// Find the place to put the button
var toolbar;
var toolbars = toolbox.externalToolbars.slice();
for ( var child of toolbox.children ) {
if ( child.localName === 'toolbar' ) {
@ -2441,7 +2440,7 @@ vAPI.toolbarButton = {
}
}
for ( toolbar of toolbars ) {
for ( var toolbar of toolbars ) {
var currentsetString = toolbar.getAttribute('currentset');
if ( !currentsetString ) {
continue;
@ -2455,10 +2454,9 @@ vAPI.toolbarButton = {
var before = null;
for ( var i = index + 1; i < currentset.length; i++ ) {
before = document.getElementById(currentset[i]);
if ( before === null ) {
continue;
if ( before !== null ) {
break;
}
break;
}
toolbar.insertItem(tbb.id, before);
}