Commit 9c0141e8 by Joakim Lahtinen

Fixed some broken HTML.

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