]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Calling selector once
authorSarven Capadisli <csarven@status.net>
Wed, 11 Nov 2009 12:31:14 +0000 (12:31 +0000)
committerSarven Capadisli <csarven@status.net>
Wed, 11 Nov 2009 12:31:14 +0000 (12:31 +0000)
plugins/Realtime/realtimeupdate.js

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