buttons: {
Save: function (evt) {
$("#edit_textinfo_status").empty();
- $(evt.target).closest('button').button("disable");
+ var mybuttons = $(evt.target).closest('button').parent().find('button');
+ mybuttons.button( 'disable' );
var requrl = _get_url([ "textinfo", selectedTextID ]);
var reqparam = $('#edit_textinfo').serialize();
$.post( requrl, reqparam, function (data) {
selectedTextInfo = data;
load_textinfo();
// Reenable the button and close the form
- $(evt.target).closest('button').button("enable");
+ mybuttons.button("enable");
$('#textinfo-edit-dialog').dialog('close');
}, 'json' );
},
buttons: {
Save: function (evt) {
$("#edit_stemma_status").empty();
- $(evt.target).closest('button').button("disable");
+ var mybuttons = $(evt.target).closest('button').parent().find('button');
+ mybuttons.button( 'disable' );
var stemmaseq = $('#stemmaseq').val();
var requrl = _get_url([ "stemma", selectedTextID, stemmaseq ]);
var reqparam = { 'dot': $('#dot_field').val() };
// Display the new stemma
load_stemma( selectedStemmaID, true );
// Reenable the button and close the form
- $(evt.target).closest('button').button("enable");
+ mybuttons.button("enable");
$('#stemma-edit-dialog').dialog('close');
}, 'json' );
},
buttons: {
Run: function (evt) {
$("#stemweb_run_status").empty();
- $(evt.target).closest('button').button("disable");
+ var mybuttons = $(evt.target).closest('button').parent().find('button');
+ mybuttons.button( 'disable' );
var requrl = _get_url([ "stemweb", "request" ]);
var reqparam = $('#call_stemweb').serialize();
// TODO We need to stash the literal SVG string in stemmata
// somehow. Implement accept header on server side to decide
// whether to send application/json or application/xml?
$.getJSON( requrl, reqparam, function (data) {
- $(evt.target).closest('button').button("enable");
+ mybuttons.button("enable");
$('#stemweb-ui-dialog').dialog('close');
if( 'jobid' in data ) {
// There is a pending job.
modal: true,
buttons: {
'Merge readings': function( evt ) {
- $( evt.target ).button( 'disable' );
+ var mybuttons = $(evt.target).closest('button').parent().find('button');
+ mybuttons.button( 'disable' );
$( '#status' ).empty();
form_values = $( '#collapse_node_form' ).serialize();
ncpath = getTextURL( 'merge' );
var jqjson = $.post( ncpath, form_values, function( data ) {
merge_nodes( $( '#source_node_id' ).val(), $( '#target_node_id' ).val(), data );
- $(evt.target).button( 'enable' );
+ mybuttons.button( 'enable' );
$( '#dialog-form' ).dialog( 'close' );
} );
},
OK: function( evt ) {
- $( evt.target ).button( 'disable' );
+ var mybuttons = $(evt.target).closest('button').parent().find('button');
+ mybuttons.button( 'disable' );
$( '#status' ).empty();
form_values = $( '#collapse_node_form' ).serialize();
ncpath = getTextURL( 'relationships' );
relation.data( k.name, k.value );
});
}
- $(evt.target).button( 'enable' );
+ mybuttons.button( 'enable' );
});
$( '#dialog-form' ).dialog( 'close' );
}, 'json' );
Cancel: function() { $( this ).dialog( "close" ); },
Detach: function ( evt ) {
var self = $(this);
- $( evt.target ).button( "disable" );
+ var mybuttons = $(evt.target).closest('button').parent().find('button');
+ mybuttons.button( 'disable' );
var form_values = $('#detach_collated_form').serialize();
ncpath = getTextURL( 'duplicate' );
var jqjson = $.post( ncpath, form_values, function(data) {
detach_node( data );
- $(evt.target).button("enable");
+ mybuttons.button("enable");
self.dialog( "close" );
} );
}
},
Update: function( evt ) {
// Disable the button
- $(evt.target).button("disable");
+ var mybuttons = $(evt.target).closest('button').parent().find('button');
+ mybuttons.button( 'disable' );
$('#reading_status').empty();
var reading_id = $('#reading_id').val()
form_values = {
if( $('#update_workspace_button').data('locked') == false ) {
color_inactive( get_ellipse( reading_id ) );
}
- $(evt.target).button("enable");
+ mybuttons.button("enable");
$( "#reading-form" ).dialog( "close" );
});
// Re-color the node if necessary