You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ss...@apache.org on 2013/11/05 21:17:31 UTC

git commit: Preferred ng-show to jQuery for #no-leader-alert.

Updated Branches:
  refs/heads/master 1293c46d4 -> 91d233218


Preferred ng-show to jQuery for #no-leader-alert.

Mixing jQuery DOM access with Angular creates two locations for state
storage. Always prefer Angular to jQuery for changing the DOM.

* Removed the "Close" button because the alert is not dismissable.

Review: https://reviews.apache.org/r/15154


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/91d23321
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/91d23321
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/91d23321

Branch: refs/heads/master
Commit: 91d233218f7c1cbf4aaba700015cbe05450bc262
Parents: 1293c46
Author: Ross Allen <ro...@gmail.com>
Authored: Tue Nov 5 10:15:58 2013 -1000
Committer: Ross Allen <ro...@gmail.com>
Committed: Tue Nov 5 10:17:10 2013 -1000

----------------------------------------------------------------------
 src/webui/master/static/index.html        | 3 +--
 src/webui/master/static/js/controllers.js | 5 +----
 2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/91d23321/src/webui/master/static/index.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/index.html b/src/webui/master/static/index.html
index 47403d8..3ba4910 100644
--- a/src/webui/master/static/index.html
+++ b/src/webui/master/static/index.html
@@ -46,8 +46,7 @@
       </div>
 
       <div class="container">
-        <div class="alert hide" id="no-leader-alert">
-          <button class="close" data-dismiss="alert">×</button>
+        <div class="alert" data-ng-show="state &amp;&amp; !state.leader">
           <strong>No master is currently leading ...</strong>
         </div>
         <div class="alert alert-error hide" id="not-leader-alert">

http://git-wip-us.apache.org/repos/asf/mesos/blob/91d23321/src/webui/master/static/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/controllers.js b/src/webui/master/static/js/controllers.js
index 0c930a2..db015b2 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -116,10 +116,7 @@
     $scope.state = $.parseJSON(data);
 
     // Determine if there is a leader (and redirect if not the leader).
-    if (!$scope.state.leader) {
-      $("#no-leader-alert").show();
-    } else {
-      $("#no-leader-alert").hide();
+    if ($scope.state.leader) {
 
       // Redirect if we aren't the leader.
       if ($scope.state.leader != $scope.state.pid) {