FIX Error when adding a bookmark after using an external GET bookmark

This commit is contained in:
Laurent Destailleur 2017-10-21 14:52:58 +02:00
parent 1426737a26
commit 270bd13f55

View File

@ -115,6 +115,7 @@ function printBookmarksList($aDb, $aLangs)
$(document).ready(function () {'; $(document).ready(function () {';
$ret.=' jQuery("#boxbookmark").change(function() { $ret.=' jQuery("#boxbookmark").change(function() {
var urlselected = jQuery("#boxbookmark option:selected").attr("rel"); var urlselected = jQuery("#boxbookmark option:selected").attr("rel");
if (! urlselected) console.log("Error, failed to get the URL to jump to from the rel attribute");
var urltarget = jQuery("#boxbookmark option:selected").attr("target"); var urltarget = jQuery("#boxbookmark option:selected").attr("target");
if (! urltarget) { urltarget=""; } if (! urltarget) { urltarget=""; }
jQuery("form#actionbookmark").attr("target",urltarget); jQuery("form#actionbookmark").attr("target",urltarget);
@ -128,9 +129,14 @@ function printBookmarksList($aDb, $aLangs)
var newmethod=\'GET\'; var newmethod=\'GET\';
jQuery("form#actionbookmark").attr("method", newmethod); jQuery("form#actionbookmark").attr("method", newmethod);
console.log("We change method to newmethod="+newmethod); console.log("We change method to newmethod="+newmethod);
}
jQuery("#actionbookmark").submit(); jQuery("#actionbookmark").submit();
console.log("We restore method to POST");
jQuery("form#actionbookmark").attr("method", \'POST\');
}
else
{
jQuery("#actionbookmark").submit();
}
});'; });';
$ret.='})</script>'; $ret.='})</script>';
$ret .= '<div class="menu_end"></div>'; $ret .= '<div class="menu_end"></div>';