When an error message is displayed, clicking on it will make it disappear

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959960 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erwan de Ferrieres
2010-07-02 12:10:58 +00:00
parent 205b0e5eeb
commit 417be33da1
2 changed files with 8 additions and 3 deletions
@@ -37,7 +37,7 @@ under the License.
<#-- display the error messages -->
<#if (errorMessage?has_content || errorMessageList?has_content)>
<div class="content-messages errorMessage">
<div id="content-messages" class="content-messages errorMessage" onclick="document.getElementById('content-messages').parentNode.removeChild(this)">
<p>${uiLabelMap.CommonFollowingErrorsOccurred}:</p>
<#if errorMessage?has_content>
<p>${errorMessage}</p>
@@ -52,7 +52,7 @@ under the License.
<#-- display the event messages -->
<#if (eventMessage?has_content || eventMessageList?has_content)>
<div class="content-messages eventMessage">
<div id="content-messages" class="content-messages eventMessage" onclick="document.getElementById('content-messages').parentNode.removeChild(this)">
<p>${uiLabelMap.CommonFollowingOccurred}:</p>
<#if eventMessage?has_content>
<p>${eventMessage}</p>
+6 -1
View File
@@ -312,13 +312,17 @@ function submitFormInBackground(form, areaId, submitUrl) {
function ajaxSubmitFormUpdateAreas(form, areaCsvString) {
submitFormDisableSubmits($(form));
waitSpinnerShow();
hideErrorContainer = function() {
$('content-messages').removeClassName('errorMessage');
new Effect.Fade('content-messages',{duration: 0.0});
}
updateFunction = function(transport) {
var data = transport.responseText.evalJSON(true);
if (data._ERROR_MESSAGE_LIST_ != undefined || data._ERROR_MESSAGE_ != undefined) {
if(!$('content-messages')) {
//add this div just after app-navigation
if($('content-main-section')){
$('content-main-section' ).insert({before: '<div id="content-messages"></div>'});
$('content-main-section' ).insert({before: '<div id="content-messages" onclick="hideErrorContainer()"></div>'});
}
}
$('content-messages').addClassName('errorMessage');
@@ -331,6 +335,7 @@ function ajaxSubmitFormUpdateAreas(form, areaCsvString) {
}
ajaxUpdateAreas(areaCsvString);
}
waitSpinnerHide();
}
new Ajax.Request($(form).action, {
parameters: $(form).serialize(true),