Calling selector once

This commit is contained in:
Sarven Capadisli 2009-11-11 12:31:14 +00:00
parent d6cd083946
commit 3874269a0b

View File

@ -157,10 +157,12 @@ RealtimeUpdate = {
addPopup: function(url, timeline, iconurl) addPopup: function(url, timeline, iconurl)
{ {
$('#notices_primary').css({'position':'relative'}); var NP = $('#notices_primary');
$('#notices_primary').prepend('<button id="realtime_timeline" title="Pop up in a window">Pop up</button>'); NP.css({'position':'relative'});
NP.prepend('<button id="realtime_timeline" title="Pop up in a window">Pop up</button>');
$('#realtime_timeline').css({ var RT = $('#realtime_timeline');
RT.css({
'margin':'0 0 11px 0', 'margin':'0 0 11px 0',
'background':'transparent url('+ iconurl + ') no-repeat 0% 30%', 'background':'transparent url('+ iconurl + ') no-repeat 0% 30%',
'padding':'0 0 0 20px', 'padding':'0 0 0 20px',
@ -170,12 +172,12 @@ RealtimeUpdate = {
'right':'0', 'right':'0',
'border':'none', 'border':'none',
'cursor':'pointer', 'cursor':'pointer',
'color':$("a").css("color"), 'color':$('a').css('color'),
'font-weight':'bold', 'font-weight':'bold',
'font-size':'1em' 'font-size':'1em'
}); });
$('#realtime_timeline').click(function() { RT.click(function() {
window.open(url, window.open(url,
timeline, timeline,
'toolbar=no,resizable=yes,scrollbars=yes,status=yes'); 'toolbar=no,resizable=yes,scrollbars=yes,status=yes');