aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-01 22:49:31 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-01 22:49:31 +0000
commitaf335c48fc3f4a741e7b5650db46aac48183c244 (patch)
treefd2b6803c2db773ef5a5be4127e3112a3cc51d79
parentc3277515ae8ad8aea53e53562fef01d339fcdeb1 (diff)
downloadelgg-af335c48fc3f4a741e7b5650db46aac48183c244.tar.gz
elgg-af335c48fc3f4a741e7b5650db46aac48183c244.tar.bz2
Fixes #2318: Adjusted system message markup + styles to work with ajax actions
git-svn-id: http://code.elgg.org/elgg/trunk@7185 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/js/lib/elgglib.js9
-rw-r--r--views/default/css.php19
-rw-r--r--views/default/messages/errors/list.php14
-rw-r--r--views/default/messages/list.php13
-rw-r--r--views/default/messages/messages/list.php15
5 files changed, 33 insertions, 37 deletions
diff --git a/engine/js/lib/elgglib.js b/engine/js/lib/elgglib.js
index 208c02716..5c32deaaf 100644
--- a/engine/js/lib/elgglib.js
+++ b/engine/js/lib/elgglib.js
@@ -144,14 +144,7 @@ elgg.system_messages = function(msgs, delay, type) {
var messages_html = [];
for (var i in msgs) {
- messages_html.push('<div class="' + classes.join(' ') + '">'
- + '<span class="closeMessages">'
- + '<a href="#">'
- + elgg.echo('systemmessages:dismiss')
- + '</a>'
- + '</span>'
- + '<p>' + msgs[i] + '</p>'
- + '</div>');
+ messages_html.push('<div class="' + classes.join(' ') + '"><p>' + msgs[i] + '</p></div>');
}
$(messages_html.join('')).appendTo('#elgg_system_messages').animate({opacity:'1.0'},delay).fadeOut('slow');
diff --git a/views/default/css.php b/views/default/css.php
index b4d88e7d9..076bfdb62 100644
--- a/views/default/css.php
+++ b/views/default/css.php
@@ -621,27 +621,30 @@ li.navigation_more ul li {
/* ***************************************
SYSTEM MESSAGES
*************************************** */
-#elgg_system_message {
+#elgg_system_messages {
+ position:fixed;
+ right:20px;
+ max-width: 500px;
+ z-index: 9600;
+}
+
+.elgg_system_message {
background-color:black;
color:white;
font-weight: bold;
display:block;
padding:3px 10px;
- z-index: 9600;
- position:fixed;
- right:20px;
margin-top:10px;
- width:auto;
- max-width: 500px;
cursor: pointer;
opacity:0.9;
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
-moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
+ z-index: 9600;
}
-#elgg_system_message.error {
+.elgg_system_message.error {
background-color:red;
}
-#elgg_system_message p {
+.elgg_system_message p {
margin:0;
}
diff --git a/views/default/messages/errors/list.php b/views/default/messages/errors/list.php
index 922f23787..5f675715d 100644
--- a/views/default/messages/errors/list.php
+++ b/views/default/messages/errors/list.php
@@ -10,15 +10,13 @@
*/
if (!empty($vars['object']) && is_array($vars['object'])) {
-
-?>
-<div id="elgg_system_message" class="hidden radius8 error">
-<script type="text/javascript">$(document).ready(function(){ elgg_system_message() });</script>
-<?php
foreach($vars['object'] as $error) {
- echo elgg_view('messages/errors/error',array('object' => $error));
- }
?>
-</div>
+
+ <div class="elgg_system_message hidden radius8 error">
+ <?php echo elgg_view('messages/errors/error',array('object' => $error)); ?>
+ </div>
+
<?php
+ }
} \ No newline at end of file
diff --git a/views/default/messages/list.php b/views/default/messages/list.php
index 3084f09f8..dc50ef071 100644
--- a/views/default/messages/list.php
+++ b/views/default/messages/list.php
@@ -8,9 +8,14 @@
*
* @uses $vars['object'] The array of message registers
*/
+?>
-if (!empty($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) {
- foreach($vars['object'] as $register => $list ) {
- echo elgg_view("messages/{$register}/list", array('object' => $list));
+<div id="elgg_system_messages">
+<?php
+ if (!empty($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) {
+ foreach($vars['object'] as $register => $list ) {
+ echo elgg_view("messages/{$register}/list", array('object' => $list));
+ }
}
-}
+?>
+</div> \ No newline at end of file
diff --git a/views/default/messages/messages/list.php b/views/default/messages/messages/list.php
index 07fae11e7..1d69c0289 100644
--- a/views/default/messages/messages/list.php
+++ b/views/default/messages/messages/list.php
@@ -10,16 +10,13 @@
*/
if (!empty($vars['object']) && is_array($vars['object'])) {
-
-?>
-<div id="elgg_system_message" class="hidden radius8">
-<script type="text/javascript">$(document).ready(function(){ elgg_system_message() });</script>
-<?php
foreach($vars['object'] as $message) {
- echo elgg_view('messages/messages/message',array('object' => $message));
- }
?>
-</div>
-<?php
+ <div class="elgg_system_message hidden radius8">
+ <?php echo elgg_view('messages/messages/message',array('object' => $message)); ?>
+ </div>
+
+<?php
+ }
}