if (xulG.unified_interface) {
xulG.disable_copy_editor = function(c) {
- addCSSClass(document.documentElement,'red_bg');
+ addCSSClass(document.documentElement,'disabled_copy_editor');
g.disabled = true;
}
xulG.enable_copy_editor = function(c) {
- removeCSSClass(document.documentElement,'red_bg');
+ removeCSSClass(document.documentElement,'disabled_copy_editor');
g.disabled = false;
xulG.refresh_copy_editor();
}
xulG.refresh_copy_editor = function() {
dump('refresh_copy_editor\n');
- addCSSClass(document.documentElement,'blue_bg');
+ addCSSClass(document.documentElement,'enabling_copy_editor');
try {
xulG.clear_update_copy_editor_timeout();
g.copies = xulG.copies;
g.check_for_unmet_required_fields();
setTimeout(
function() {
- removeCSSClass(document.documentElement,'blue_bg');
+ removeCSSClass(document.documentElement,'enabling_copy_editor');
}, 1000
);
} catch(E) {
g.gather_copies();
}
}
- $('Sync').addEventListener(
- 'command',
- function() {
- // give gather_copies_soon fired off directly/indirectly by
- // onchange a chance to go first
- setTimeout(
- function() {
- xulG.enable_copy_editor();
- },
- 0
- );
- },
- false
- );
} else {
$('Create').hidden = true;
- $('Sync').hidden = true;
}
/***********************************************************************************************************/
g.load_prefs();
if (g.existing_copies.length > 0) {
- g.gather_copies_soon();
+ g.gather_copies_soon(true);
}
try {
util.widgets.apply_vertical_tab_on_enter_handler(
tb,
function() { render_copy_count_entry({'target':tb}); setTimeout(function(){util.widgets.vertical_tab(tb);},0); }
- ,function() { $('Sync').disabled = true; }
+ ,function() { g.delay_gather_copies_soon(false); }
);
tb.addEventListener( 'change', render_copy_count_entry, false);
- tb.addEventListener( 'change', g.gather_copies_soon, false);
+ //tb.addEventListener( 'change', g.gather_copies_soon, false);
tb.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
setTimeout(
function() {
},0
);
}
- ,function() { $('Sync').disabled = true; }
+ ,function() { g.delay_gather_copies_soon(false); }
);
call_number_column_textbox.addEventListener( 'change', handle_change_to_callnumber_data, false);
//call_number_column_textbox.addEventListener( 'change', g.gather_copies_soon, false);
},0
);
}
- ,function() { $('Sync').disabled = true; }
+ ,function() { g.delay_gather_copies_soon(false); }
);
number_of_copies_column_textbox.addEventListener( 'change', handle_change_number_of_copies_column_textbox, false);
- number_of_copies_column_textbox.addEventListener( 'change', g.gather_copies_soon, false);
+ //number_of_copies_column_textbox.addEventListener( 'change', g.gather_copies_soon, false);
number_of_copies_column_textbox.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
if ( !g.last_focus ) { number_of_copies_column_textbox.focus(); g.last_focus = number_of_copies_column_textbox; }
barcode_tb.setAttribute('bmp_id',menulist.selectedItem.value);
button.hidden = true;
}
- g.gather_copies_soon();
+ g.gather_copies_soon(true);
}
});
},
},
false
);
- menulist.addEventListener('change',g.gather_copies_soon,false);
+ menulist.addEventListener('change',function() { g.gather_copies_soon(true); },false);
menulist.addEventListener(
'command',
function(ev) {
},
false
);
- menulist.addEventListener('command',g.gather_copies_soon,false);
+ menulist.addEventListener('command',function() { g.gather_copies_soon(true); },false);
return hbox;
}
util.widgets.apply_vertical_tab_on_enter_handler(
tb,
function() { ready_to_create({'target':tb}); setTimeout(function(){util.widgets.vertical_tab(tb);},0); },
- g.delay_gather_copies_soon
+ function() { g.delay_gather_copies_soon(true); }
);
util.widgets.apply_vertical_tab_on_enter_handler(
part_menu.firstChild,
function() { setTimeout(function(){util.widgets.vertical_tab(part_menu.firstChild);},0); },
- g.delay_gather_copies_soon
+ function() { g.delay_gather_copies_soon(true); }
);
tb.addEventListener('change', function(ev) {
var barcode = String( ev.target.value ).replace(/\s/g,'');
}
}
- g.gather_copies_soon();
+ g.gather_copies_soon(true);
setTimeout( function() { if (g.first_focus) { g.first_focus.focus(); } }, 0 );
} catch(E) {
setTimeout(
function() {
- g.gather_copies_soon();
+ g.gather_copies_soon(true);
},0
);
}
}
-g.delay_gather_copies_soon = function() {
+g.delay_gather_copies_soon = function(enable_copy_editor) {
if (xulG.unified_interface) {
dump('g.delay_gather_copies_soon()\n');
- g.gather_copies_soon();
+ g.gather_copies_soon(enable_copy_editor);
}
}
-g.gather_copies_soon = function(ev) {
+g.gather_copies_soon = function(enable_copy_editor) {
try {
if (!xulG.unified_interface) { return; }
dump('g.gather_copies_soon()\n');
if (typeof xulG.disable_copy_editor == 'function') {
xulG.disable_copy_editor();
}
- $('Sync').disabled = true;
if (g.update_copy_editor_timeoutID) {
clearTimeout(g.update_copy_editor_timeoutID);
}
function() {
try {
g.gather_copies();
- //xulG.enable_copy_editor();
- $('Sync').disabled = false;
+ if (enable_copy_editor) {
+ xulG.enable_copy_editor();
+ }
xulG.refresh_copy_editor();
} catch(E) {
dump('Error in volume_copy_editor.js with g.gather_copies_soon setTimeout func(): ' + E + '\n');
}
setTimeout(
function() {
- g.gather_copies_soon();
+ g.gather_copies_soon(true);
},0
);
if (g.last_focus) setTimeout( function() { g.last_focus.focus(); }, 0 );