X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=stemmaweb%2Froot%2Fjs%2Frelationship.js;h=3fa40d1bc41b2eec15c8310eff4bc0bbb165d3a5;hb=a7f4020a1a1fd72aba6e25dc0a8f8aa9a1891202;hp=0c346437dce29f2e988a5f6a7ecac220afcae19f;hpb=fedee8dac79426f8a1f7ae70d95478c6fcd5d69a;p=scpubgit%2Fstemmatology.git diff --git a/stemmaweb/root/js/relationship.js b/stemmaweb/root/js/relationship.js index 0c34643..3fa40d1 100644 --- a/stemmaweb/root/js/relationship.js +++ b/stemmaweb/root/js/relationship.js @@ -692,7 +692,8 @@ $(document).ready(function () { $("#dialog_overlay").hide(); } }).ajaxError( function(event, jqXHR, ajaxSettings, thrownError) { - if( ( ajaxSettings.type == 'POST' ) && jqXHR.status == 403 ) { + if( ajaxSettings.url == getTextURL('relationships') + && ajaxSettings.type == 'POST' && jqXHR.status == 403 ) { var errobj = jQuery.parseJSON( jqXHR.responseText ); $('#status').append( '

Error: ' + errobj.error + '
The relationship cannot be made.

' ); } @@ -747,6 +748,7 @@ $(document).ready(function () { $( this ).dialog( "close" ); }, Update: function() { + $('#reading_status').empty(); var reading_id = $('#reading_id').val() form_values = { 'id' : reading_id, @@ -781,6 +783,7 @@ $(document).ready(function () { open: function() { $(".ui-widget-overlay").css("background", "none"); $("#dialog_overlay").show(); + $('#reading_status').empty(); $("#dialog_overlay").height( $("#enlargement_container").height() ); $("#dialog_overlay").width( $("#enlargement_container").innerWidth() ); $("#dialog_overlay").offset( $("#enlargement_container").offset() ); @@ -788,6 +791,12 @@ $(document).ready(function () { close: function() { $("#dialog_overlay").hide(); } + }).ajaxError( function(event, jqXHR, ajaxSettings, thrownError) { + if( ajaxSettings.url.lastIndexOf( getReadingURL('') ) > -1 + && ajaxSettings.type == 'POST' && jqXHR.status == 403 ) { + var errobj = jQuery.parseJSON( jqXHR.responseText ); + $('#reading_status').append( '

Error: ' + errobj.error + '

' ); + } });