[Hastymail-cvs] SF.net SVN: hastymail:[664] trunk/hastymail2
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2008-12-19 19:36:44
|
Revision: 664 http://hastymail.svn.sourceforge.net/hastymail/?rev=664&view=rev Author: sailfrog Date: 2008-12-19 19:36:40 +0000 (Fri, 19 Dec 2008) Log Message: ----------- disable the destination folder dropdown on the message view prev/next/up + action form when the action is not set to move or copy. Modified Paths: -------------- trunk/hastymail2/js/site.js trunk/hastymail2/lib/site_page_class.php Modified: trunk/hastymail2/js/site.js =================================================================== --- trunk/hastymail2/js/site.js 2008-12-19 05:40:03 UTC (rev 663) +++ trunk/hastymail2/js/site.js 2008-12-19 19:36:40 UTC (rev 664) @@ -332,3 +332,13 @@ return hm_confirm(message); } } +function disable_destination() { + var select = document.getElementById('prev_next_action'); + var action = select.options[select.selectedIndex].value; + if (action == 'move' || action == 'copy') { + document.getElementById('prev_next_folder').disabled = false; + } + else { + document.getElementById('prev_next_folder').disabled = true; + } +} Modified: trunk/hastymail2/lib/site_page_class.php =================================================================== --- trunk/hastymail2/lib/site_page_class.php 2008-12-19 05:40:03 UTC (rev 663) +++ trunk/hastymail2/lib/site_page_class.php 2008-12-19 19:36:40 UTC (rev 664) @@ -663,7 +663,7 @@ $data .= 'class="button" '; } $data .= 'name="next_action" src="'.$img_path.'/next.png" /></td>'; - $data .= '<td colspan="3" align="center"> and <select id="prev_next_action" name="prev_next_action">'; + $data .= '<td colspan="3" align="center"> and <select onchange="disable_destination();" id="prev_next_action" name="prev_next_action">'; $selected = false; if (isset($_SESSION['last_prev_next_action'])) { $selected = $_SESSION['last_prev_next_action']; @@ -681,7 +681,11 @@ } $data .= 'value="'.$i.'">'.$v.'</option>'; } - $data .= '</select> '.$this->user->str[55].':  <select name="prev_next_folder">'. + $data .= '</select> '.$this->user->str[55].':  <select '; + if ($selected != 'move' && $selected != 'copy') { + $data .= 'disabled="disabled" '; + } + $data .= 'id="prev_next_folder" name="prev_next_folder">'. $this->print_folder_option_list($this->pd['folders'], false, 0, array($this->pd['last_prev_next_folder']), true, true).'</select>'; $data .= '</td>'; $data .= '</tr></table>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |