From: <mp...@kr...> - 2008-03-14 21:12:57
|
Revision: 4993 Author: mpeters Date: 2008-03-14 17:12:58 -0400 (Fri, 14 Mar 2008) Log Message: ----------- Fixing Krang.Form.submit() so that if new_window is passed the new window will have the same name as this current window + 'b'. This allows it to share the same session and not have to worry about krang logging you out because it thinks you're starting a new window. Modified Paths: -------------- branches/krang_v3_02/htdocs/js/krang.js Modified: branches/krang_v3_02/htdocs/js/krang.js =================================================================== --- branches/krang_v3_02/htdocs/js/krang.js 2008-03-14 19:54:29 UTC (rev 4992) +++ branches/krang_v3_02/htdocs/js/krang.js 2008-03-14 21:12:58 UTC (rev 4993) @@ -177,7 +177,12 @@ }, _id_from_name : function() { - return window.name.match(/^krang_window_/) && window.name.match(/\d+$/); + var matches = window.name.match(/^krang_window_(\d+)/); + if(matches == null ) { + return null; + } else { + return matches[1]; + } }, _id_from_pool : function() { @@ -543,7 +548,8 @@ // save the old target of the form so we can restore it after // submission var old_target = form.target; - form.target = '_blank'; + form.target = window.name + '_b'; + Krang.Window.pass_id(); form.submit(); form.target = old_target; } else { |