Commit 9c0141e8 by Joakim Lahtinen

Fixed some broken HTML.

Simplified some control flow.
parent 24b9bc1e
......@@ -22,7 +22,6 @@ function (_) {
appSubUrl: ""
};
var settings = _.extend({}, defaults, options);
return settings;
return _.extend({}, defaults, options);
};
});
......@@ -12,7 +12,7 @@ define([], function() {
if (def !== void 0 && !this.exists(key)) {
return def;
}
return window.localStorage[key] === 'true' ? true : false;
return window.localStorage[key] === 'true';
},
exists: function(key) {
return window.localStorage[key] !== void 0;
......
......@@ -26,7 +26,7 @@ function (angular, $, _, moment) {
this.tags = data.tags || [];
this.style = data.style || "dark";
this.timezone = data.timezone || 'browser';
this.editable = data.editable === false ? false : true;
this.editable = data.editable !== false;
this.hideControls = data.hideControls || false;
this.sharedCrosshair = data.sharedCrosshair || false;
this.rows = data.rows || [];
......@@ -48,10 +48,10 @@ function (angular, $, _, moment) {
p._initMeta = function(meta) {
meta = meta || {};
meta.canShare = meta.canShare === false ? false : true;
meta.canSave = meta.canSave === false ? false : true;
meta.canStar = meta.canStar === false ? false : true;
meta.canEdit = meta.canEdit === false ? false : true;
meta.canShare = meta.canShare !== false;
meta.canSave = meta.canSave !== false;
meta.canStar = meta.canStar !== false;
meta.canEdit = meta.canEdit !== false;
if (!this.editable) {
meta.canEdit = false;
......@@ -151,7 +151,6 @@ function (angular, $, _, moment) {
result.panel = panel;
result.row = row;
result.index = index;
return;
}
});
});
......
......@@ -25,7 +25,7 @@
<td>
<button class="btn btn-inverse pull-right" ng-click="import(dash.name)">
Load
</a>
</button>
</td>
</tr>
</table>
......
......@@ -122,11 +122,7 @@ function(angular, _) {
var currentJson = angular.toJson(current);
var originalJson = angular.toJson(original);
if (currentJson !== originalJson) {
return true;
}
return false;
return currentJson !== originalJson;
};
p.open_modal = function() {
......
......@@ -52,7 +52,7 @@ function (angular, _) {
if (link.asDropdown) {
template += '<ul class="dropdown-menu" role="menu">' +
'<li ng-repeat="dash in link.searchHits"><a href="{{dash.url}}"><i class="fa fa-th-large"></i> {{dash.title}}</a></li>' +
'</ul';
'</ul>';
}
elem.html(template);
......
......@@ -45,7 +45,7 @@
{{invite.email}}
<span ng-show="invite.name" style="padding-left: 20px"> {{invite.name}}</span>
<span class="pull-right">
<button class="btn btn-inverse btn-mini " data-clipboard-text="{{invite.url}}" clipboard-button ng-click="copyInviteToClipboard($event)"
<button class="btn btn-inverse btn-mini " data-clipboard-text="{{invite.url}}" clipboard-button ng-click="copyInviteToClipboard($event)">
<i class="fa fa-clipboard"></i> Copy Invite
</button>
&nbsp;
......
......@@ -64,8 +64,7 @@ function (angular, $, _) {
}
function getExtendedMenu($scope) {
var menu = angular.copy($scope.panelMeta.extendedMenu);
return menu;
return angular.copy($scope.panelMeta.extendedMenu);
}
return {
......
......@@ -855,7 +855,7 @@ var _DoLists = function(text) {
// Turn double returns into triple returns, so that we can make a
// paragraph for the last item in a list, if necessary:
list = list.replace(/\n{2,}/g,"\n\n\n");;
list = list.replace(/\n{2,}/g,"\n\n\n");
var result = _ProcessListItems(list);
// Trim any trailing whitespace, to put the closing `</$list_type>`
......@@ -875,7 +875,7 @@ var _DoLists = function(text) {
var list_type = (m3.search(/[*+-]/g)>-1) ? "ul" : "ol";
// Turn double returns into triple returns, so that we can make a
// paragraph for the last item in a list, if necessary:
var list = list.replace(/\n{2,}/g,"\n\n\n");;
list = list.replace(/\n{2,}/g,"\n\n\n");
var result = _ProcessListItems(list);
result = runup + "<"+list_type+">\n" + result + "</"+list_type+">\n";
return result;
......
......@@ -161,8 +161,7 @@ function (_) {
};
p._modifyRawQuery = function () {
var query = this.target.query.replace(";", "");
return query;
return this.target.query.replace(";", "");
};
return InfluxQueryBuilder;
......
......@@ -111,11 +111,9 @@ function (angular, _, moment, dateMath) {
var url = '/api/v1/label/__name__/values';
return this._request('GET', url).then(function(result) {
var suggestData = _.filter(result.data.data, function(metricName) {
return _.filter(result.data.data, function (metricName) {
return metricName.indexOf(query) !== 1;
});
return suggestData;
});
};
......
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