Browse Source

Avoid unnecessary jquery calls.

j8
Boris Grozev 10 years ago
parent
commit
029851fe3f
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      modules/UI/toolbars/Toolbar.js

+ 8
- 6
modules/UI/toolbars/Toolbar.js View File

@@ -549,12 +549,13 @@ var Toolbar = (function (my) {
549 549
 
550 550
     // Sets the state of the recording button
551 551
     my.setRecordingButtonState = function (isRecording) {
552
+        var selector = $('#recordButton');
552 553
         if (isRecording) {
553
-            $('#recordButton').removeClass("icon-recEnable");
554
-            $('#recordButton').addClass("icon-recEnable active");
554
+            selector.removeClass("icon-recEnable");
555
+            selector.addClass("icon-recEnable active");
555 556
         } else {
556
-            $('#recordButton').removeClass("icon-recEnable active");
557
-            $('#recordButton').addClass("icon-recEnable");
557
+            selector.removeClass("icon-recEnable active");
558
+            selector.addClass("icon-recEnable");
558 559
         }
559 560
     };
560 561
 
@@ -573,8 +574,9 @@ var Toolbar = (function (my) {
573 574
      */
574 575
     my.setAuthenticatedIdentity = function (authIdentity) {
575 576
         if (authIdentity) {
576
-            $('#toolbar_auth_identity').css({display: "list-item"});
577
-            $('#toolbar_auth_identity').text(authIdentity);
577
+            var selector = $('#toolbar_auth_identity');
578
+            selector.css({display: "list-item"});
579
+            selector.text(authIdentity);
578 580
         } else {
579 581
             $('#toolbar_auth_identity').css({display: "none"});
580 582
         }

Loading…
Cancel
Save