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/07/27 02:53:33 UTC
git commit: Remove 'ui-if' direction in favor of 'ng-show'
Updated Branches:
refs/heads/master 5b163e4a2 -> e88b1bde4
Remove 'ui-if' direction in favor of 'ng-show'
Angular provides 'ng-show' to hide elements when not needed. They are
rendered in the DOM unlike with 'ui-if', but using native Angular
prevents needing outside code or dependencies for a directive used in
only one template.
Review: http://reviews.apache.org/r/12888/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e88b1bde
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e88b1bde
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e88b1bde
Branch: refs/heads/master
Commit: e88b1bde44e0efbe5121531a3c64293e3afd415a
Parents: 5b163e4
Author: Ross Allen <re...@gmail.com>
Authored: Tue Jul 23 16:33:37 2013 -0700
Committer: Ross Allen <re...@gmail.com>
Committed: Fri Jul 26 17:53:28 2013 -0700
----------------------------------------------------------------------
src/webui/master/static/browse.html | 26 +++++++++++----------
src/webui/master/static/js/app.js | 39 --------------------------------
2 files changed, 14 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/e88b1bde/src/webui/master/static/browse.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/browse.html b/src/webui/master/static/browse.html
index 5b54d19..fe8be00 100644
--- a/src/webui/master/static/browse.html
+++ b/src/webui/master/static/browse.html
@@ -55,20 +55,22 @@
<td>{{file.gid}}</td>
<td class="text-right">{{file.size | dataSize}}</td>
<td class="text-right">{{file.mtime * 1000 | unixDate}}</td>
- <td ui-if="file.mode[0] == 'd'">
- <i class="icon-folder-close"></i>
- <a href="#/slaves/{{slave_id}}/browse?path={{encodeURIComponent(file.path)}}">
- {{basename(file.path)}}
- </a>
- </td>
- <td ui-if="file.mode[0] != 'd'">
- <i class="icon-file" style="visibility: hidden;"></i>
- <a href="" ng-click="pail($event, encodeURIComponent(file.path))">
- {{basename(file.path)}}
- </a>
+ <td>
+ <span data-ng-show="file.mode[0] == 'd'">
+ <i class="icon-folder-close"></i>
+ <a href="#/slaves/{{slave_id}}/browse?path={{encodeURIComponent(file.path)}}">
+ {{basename(file.path)}}
+ </a>
+ </span>
+ <span data-ng-show="file.mode[0] != 'd'">
+ <i class="icon-file" style="visibility: hidden;"></i>
+ <a href="" ng-click="pail($event, encodeURIComponent(file.path))">
+ {{basename(file.path)}}
+ </a>
+ </span>
</td>
<td>
- <a ui-if="file.mode[0] != 'd'"
+ <a data-ng-show="file.mode[0] != 'd'"
href="http://{{slave_host}}/files/download.json?path={{encodeURIComponent(file.path)}}">
<button class="btn btn-mini" type="button">
Download
http://git-wip-us.apache.org/repos/asf/mesos/blob/e88b1bde/src/webui/master/static/js/app.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/app.js b/src/webui/master/static/js/app.js
index 6637513..d59e22c 100644
--- a/src/webui/master/static/js/app.js
+++ b/src/webui/master/static/js/app.js
@@ -79,45 +79,6 @@
}
};
})
- // Defines the ui-if tag. This removes/adds an element from the DOM depending on a condition
- // Originally created by @tigbro, for the @jquery-mobile-angular-adapter
- // https://github.com/tigbro/jquery-mobile-angular-adapter
- .directive('uiIf', [function() {
- return {
- transclude: 'element',
- priority: 1000,
- terminal: true,
- restrict: 'A',
- compile: function (element, attr, linker) {
- return function (scope, iterStartElement, attr) {
- iterStartElement[0].doNotMove = true;
- var expression = attr.uiIf;
- var lastElement;
- var lastScope;
- scope.$watch(expression, function (newValue) {
- if (lastElement) {
- lastElement.remove();
- lastElement = null;
- }
- if (lastScope) {
- lastScope.$destroy();
- lastScope = null;
- }
- if (newValue) {
- lastScope = scope.$new();
- linker(lastScope, function (clone) {
- lastElement = clone;
- iterStartElement.after(clone);
- });
- }
- // Note: need to be parent() as jquery cannot trigger events on comments
- // (angular creates a comment node when using transclusion, as ng-repeat does).
- iterStartElement.parent().trigger("$childrenChanged");
- });
- };
- }
- };
- }])
// Defines the 'clipboard' directive, which integrates copying to the user's
// clipboard with an Adobe Flash object via the ZeroClipboard library.
//