Commit 96550140 by Torkel Ödegaard

More polish and refinements to dashboard links

parent 85e65e61
...@@ -90,9 +90,11 @@ ...@@ -90,9 +90,11 @@
<li class="tight-form-item"> <li class="tight-form-item">
<editor-checkbox text="Show title" model="row.showTitle"></editor-checkbox> <editor-checkbox text="Show title" model="row.showTitle"></editor-checkbox>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item last">
<i ng-click="_.move(dashboard.rows,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i> <i ng-click="_.move(dashboard.rows,$index,$index-1)" ng-class="{'invisible': $first}" class="pointer fa fa-arrow-up"></i>
<i ng-click="_.move(dashboard.rows,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i> </li>
<li class="tight-form-item last">
<i ng-click="_.move(dashboard.rows,$index,$index+1)" ng-class="{'invisible': $last}" class="pointer fa fa-fw fa-arrow-down"></i>
</li> </li>
<li class="tight-form-item last"> <li class="tight-form-item last">
<i ng-click="dashboard.rows = _.without(dashboard.rows,row)" class="pointer fa fa-remove"></i> <i ng-click="dashboard.rows = _.without(dashboard.rows,row)" class="pointer fa fa-remove"></i>
......
<div class="editor-row"> <div class="editor-row">
<div class="tight-form-section">
<h5>Links and Dash Navigation</h5> <h5>Links and Dash Navigation</h5>
<div class="tight-form" ng-repeat-start="link in dashboard.links" style="margin-top: 10px;"> <div ng-repeat="link in dashboard.links" style="margin-top: 10px;">
<div class="tight-form">
<ul class="tight-form-list pull-right">
<li class="tight-form-item">
<i ng-click="moveLink($index, -1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i>
<i ng-click="moveLink($index, 1)" ng-hide="$last" class="pointer fa fa-fw fa-arrow-down"></i>
</li>
<li class="tight-form-item last">
<i class="fa fa-remove pointer" ng-click="deleteLink(link)"></i>
</li>
</ul>
<ul class="tight-form-list"> <ul class="tight-form-list">
<li class="tight-form-item" style="width: 20px"> <li class="tight-form-item" style="width: 20px">
<i class="fa fa-fw fa-unlink"></i> <i class="fa fa-fw fa-unlink"></i>
...@@ -10,7 +20,7 @@ ...@@ -10,7 +20,7 @@
<li class="tight-form-item">Type</li> <li class="tight-form-item">Type</li>
<li> <li>
<select class="input-medium tight-form-input" style="width: 151px;" ng-model="link.type" ng-options="f for f in ['dashboards','link']" ng-change="updated()"></select> <select class="input-medium tight-form-input" style="width: 150px;" ng-model="link.type" ng-options="f for f in ['dashboards','link']" ng-change="updated()"></select>
</li> </li>
<li class="tight-form-item" ng-show="link.type === 'dashboards'">With tag</li> <li class="tight-form-item" ng-show="link.type === 'dashboards'">With tag</li>
...@@ -20,20 +30,14 @@ ...@@ -20,20 +30,14 @@
<li class="tight-form-item" ng-show="link.type === 'link'" style="width: 51px">Url</li> <li class="tight-form-item" ng-show="link.type === 'link'" style="width: 51px">Url</li>
<li ng-show="link.type === 'link'"> <li ng-show="link.type === 'link'">
<input type="text" ng-model="link.url" class="input-xlarge tight-form-input" ng-model-onblur ng-change="updated()"> <input type="text" ng-model="link.url" class="input-xlarge tight-form-input" style="width: 302px;" ng-model-onblur ng-change="updated()">
</li>
<li class="tight-form-item">
<i ng-click="moveLink($index,-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i>
<i ng-click="moveLink($index,1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item" ng-show="link.type === 'link'">
<i class="fa fa-remove pointer" ng-click="deleteLink(link)"></i> <editor-checkbox text="Open in new tab " model="link.targetBlank" change="updated()"></editor-checkbox>
</li> </li>
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div ng-repeat-end>
<div class="tight-form" ng-if="link.type === 'link'"> <div class="tight-form" ng-if="link.type === 'link'">
<ul class="tight-form-list"> <ul class="tight-form-list">
<li class="tight-form-item" style="width: 20px"> <li class="tight-form-item" style="width: 20px">
...@@ -43,21 +47,20 @@ ...@@ -43,21 +47,20 @@
<li ng-show="link.type === 'link'"> <li ng-show="link.type === 'link'">
<input type="text" ng-model="link.title" class="input-medium tight-form-input" ng-model-onblur ng-change="updated()"> <input type="text" ng-model="link.title" class="input-medium tight-form-input" ng-model-onblur ng-change="updated()">
</li> </li>
<li class="tight-form-item" ng-show="link.type === 'link'" style="width: 52px">Tooltip</li> <li class="tight-form-item" ng-show="link.type === 'link'" style="width: 51px">Tooltip</li>
<li ng-show="link.type === 'link'"> <li ng-show="link.type === 'link'">
<input type="text" ng-model="link.tooltip" class="input-medium tight-form-input" placeholder="Open dashbord" ng-model-onblur ng-change="updated()"> <input type="text" ng-model="link.tooltip" class="input-medium tight-form-input" style="width: 151px" placeholder="Open dashbord" ng-model-onblur ng-change="updated()">
</li> </li>
<li class="tight-form-item" ng-show="link.type === 'link'">Icon</li> <li class="tight-form-item" ng-show="link.type === 'link'">Icon</li>
<li ng-show="link.type === 'link'"> <li ng-show="link.type === 'link'">
<select class="input-medium tight-form-input" style="width: 110px;" ng-model="link.icon" ng-options="k as k for (k, v) in iconMap" ng-change="updated()"></select> <select class="input-medium tight-form-input" style="width: 110px;" ng-model="link.icon" ng-options="k as k for (k, v) in iconMap" ng-change="updated()"></select>
</li> </li>
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
<!-- <div class="tight&#45;form"> --> </div>
<!-- <div class="tight&#45;form"> -->
<!-- <ul class="tight&#45;form&#45;list" role="menu"> --> <!-- <ul class="tight&#45;form&#45;list" role="menu"> -->
<!-- <li class="tight&#45;form&#45;item"> --> <!-- <li class="tight&#45;form&#45;item"> -->
<!-- <i class="fa fa&#45;remove invisible"></i> --> <!-- <i class="fa fa&#45;remove invisible"></i> -->
...@@ -72,9 +75,6 @@ ...@@ -72,9 +75,6 @@
<!-- </ul> --> <!-- </ul> -->
<!-- <div class="clearfix"></div> --> <!-- <div class="clearfix"></div> -->
<!-- </div> --> <!-- </div> -->
</div>
</div>
</div>
<div class="editor-row"> <div class="editor-row">
<br> <br>
......
...@@ -62,6 +62,7 @@ function (angular, _) { ...@@ -62,6 +62,7 @@ function (angular, _) {
// tooltip // tooltip
elem.find('a').tooltip({ title: scope.link.tooltip, html: true, container: 'body' }); elem.find('a').tooltip({ title: scope.link.tooltip, html: true, container: 'body' });
icon.attr('class', 'fa fa-fw ' + scope.link.icon); icon.attr('class', 'fa fa-fw ' + scope.link.icon);
anchor.attr('target', scope.link.target);
update(); update();
scope.$on('refresh', update); scope.$on('refresh', update);
...@@ -94,7 +95,9 @@ function (angular, _) { ...@@ -94,7 +95,9 @@ function (angular, _) {
return $q.when([{ return $q.when([{
url: linkDef.url, url: linkDef.url,
title: linkDef.title, title: linkDef.title,
icon: iconMap[linkDef.icon] icon: iconMap[linkDef.icon],
tooltip: linkDef.tooltip,
target: linkDef.targetBlank ? "_blank" : "",
}]); }]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment