aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/lib/elgglib.js8
-rw-r--r--js/lib/languages.js3
-rw-r--r--js/lib/ui.js4
-rw-r--r--js/tests/ElggLibTest.js2
4 files changed, 12 insertions, 5 deletions
diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js
index dc7c07165..af2c94000 100644
--- a/js/lib/elgglib.js
+++ b/js/lib/elgglib.js
@@ -347,8 +347,12 @@ elgg.system_messages = function(msgs, delay, type) {
msgs.forEach(appendMessage);
- $(messages_html.join('')).appendTo(systemMessages)
- .animate({opacity: '1.0'}, delay).fadeOut('slow');
+ if (type != 'error') {
+ $(messages_html.join('')).appendTo(systemMessages)
+ .animate({opacity: '1.0'}, delay).fadeOut('slow');
+ } else {
+ $(messages_html.join('')).appendTo(systemMessages);
+ }
};
/**
diff --git a/js/lib/languages.js b/js/lib/languages.js
index a8ba72c31..99a1ba0ee 100644
--- a/js/lib/languages.js
+++ b/js/lib/languages.js
@@ -4,6 +4,9 @@
*/
elgg.provide('elgg.config.translations');
+// default language - required by unit tests
+elgg.config.language = 'en';
+
/**
* Analagous to the php version. Merges translations for a
* given language into the current translations map.
diff --git a/js/lib/ui.js b/js/lib/ui.js
index 616e71d54..413078b4f 100644
--- a/js/lib/ui.js
+++ b/js/lib/ui.js
@@ -10,7 +10,7 @@ elgg.ui.init = function () {
});
$('.elgg-system-messages li').animate({opacity: 0.9}, 6000);
- $('.elgg-system-messages li').fadeOut('slow');
+ $('.elgg-system-messages li.elgg-state-success').fadeOut('slow');
$('[rel=toggle]').live('click', elgg.ui.toggles);
@@ -283,7 +283,7 @@ elgg.ui.initDatePicker = function() {
dataType: "script",
cache: true,
success: loadDatePicker,
- error: loadDatePicker, // english language is already loaded.
+ error: loadDatePicker // english language is already loaded.
});
}
};
diff --git a/js/tests/ElggLibTest.js b/js/tests/ElggLibTest.js
index a29ebf743..2a676e22a 100644
--- a/js/tests/ElggLibTest.js
+++ b/js/tests/ElggLibTest.js
@@ -99,7 +99,7 @@ ElggLibTest.prototype.testNormalizeUrl = function() {
['/mod/plugin/file.php', elgg.config.wwwroot + 'mod/plugin/file.php'],
['/mod/plugin/file.php?p=v&p2=v2', elgg.config.wwwroot + 'mod/plugin/file.php?p=v&p2=v2'],
['/rootfile.php', elgg.config.wwwroot + 'rootfile.php'],
- ['/rootfile.php?p=v&p2=v2', elgg.config.wwwroot + 'rootfile.php?p=v&p2=v2'],
+ ['/rootfile.php?p=v&p2=v2', elgg.config.wwwroot + 'rootfile.php?p=v&p2=v2']
].forEach(function(args) {
assertEquals(args[1], elgg.normalize_url(args[0]));