comparison popups.js @ 6:e02de6b2566e

Ensure that data.messages is set before checking its length
author Franck Deroche <franck@defr.org>
date Fri, 31 Dec 2010 14:07:33 +0100
parents be7efc2a145e
children
comparison
equal deleted inserted replaced
5:be7efc2a145e 6:e02de6b2566e
976 else { // Normal, targeted ajax, reload behavior. 976 else { // Normal, targeted ajax, reload behavior.
977 var showingMessagePopup = false; 977 var showingMessagePopup = false;
978 // Show messages in dialog and embed the results in the original page. 978 // Show messages in dialog and embed the results in the original page.
979 // TODO - should seperate these two functions. 979 // TODO - should seperate these two functions.
980 // var showMessage = data.messages.length && !popup.options.noMessage; 980 // var showMessage = data.messages.length && !popup.options.noMessage;
981 if (data.messages.length) { 981 if (data.messages && data.messages.length) {
982 // If we just dismissed the last popup dialog. 982 // If we just dismissed the last popup dialog.
983 if (!Popups.activePopup() && !popup.options.noMessage) { 983 if (!Popups.activePopup() && !popup.options.noMessage) {
984 // Show drupal_set_message in message popup. 984 // Show drupal_set_message in message popup.
985 var messagePopup = Popups.message(data.messages); 985 var messagePopup = Popups.message(data.messages);
986 if (Popups.originalSettings.popups.autoCloseFinalMessage) { 986 if (Popups.originalSettings.popups.autoCloseFinalMessage) {