From: Ben Klang Date: Tue, 9 Mar 2010 04:41:04 +0000 (-0500) Subject: Shout: Add cancel button for editActionForm X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=03faa64cb6553fcf522c1925229747f2addd3820;p=horde.git Shout: Add cancel button for editActionForm --- diff --git a/shout/templates/dialplan/edit.inc b/shout/templates/dialplan/edit.inc index 01712fced..c51ca0dd7 100644 --- a/shout/templates/dialplan/edit.inc +++ b/shout/templates/dialplan/edit.inc @@ -38,7 +38,7 @@ var curDigit = null; function editAction(digit) { if ($('selectActionForm') == null) { - curDigit = digit; + var curDigit = digit; $('digitGraphic').src = '/digit-'+digit+'.png'; // Draw the selectActionForm @@ -63,6 +63,15 @@ function editAction(digit) }); form.appendChild(select); $('selectAction').appendChild(form); + + // Cancel button + var span = document.createElement('span'); + span.id = 'cancelAction'; + span.setAttribute('onclick', 'cancelEdit()'); + var text = document.createTextNode(''); + span.appendChild(text); + $('selectAction').appendChild(span); + } else { var action = null; // Draw the options for this action @@ -94,10 +103,28 @@ function saveAction(digit) empty('selectAction'); empty('editAction'); $('editActionOverlay').hide(); + new Ajax.Request(ajax_url + 'getMenuInfo', + { + method: 'post', + parameters: $H({ + 'menu': menu + }), + onSuccess: function(r) { + menuInfo = $H(r.responseJSON.response); + refreshMenu(); + } + }); } }); } +function cancelEdit() +{ + empty($('selectAction')); + empty($('editAction')); + $('editActionOverlay').hide(); +} + function changeSoundfile() { alert("Changing soundfile"); diff --git a/shout/themes/screen.css b/shout/themes/screen.css index 68e770cdc..c37f150f0 100644 --- a/shout/themes/screen.css +++ b/shout/themes/screen.css @@ -139,6 +139,14 @@ ul { background-image: url('graphics/transparency.png'); } +#cancelAction { + position: absolute; + bottom: 5px; + right: 50px; + cursor: pointer; + text-decoration: underline; +} + #digitGraphic { float: left; margin: 0px 5px 5px 5px; @@ -157,4 +165,9 @@ ul { { text-align: right; font-style: italic; +} + +.buttonDetail +{ + text-align: center; } \ No newline at end of file