Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load Chart drop-down menu: cosmetic improvements #144

Merged
merged 1 commit into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions html/gui/css/MetricExplorer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* MetricExplorer.css */

.metric-explorer-dirty-chart-record {
background: url(/gui/images/exclamation.png) no-repeat 2px 1px;
padding-left: 16px;
}
24 changes: 20 additions & 4 deletions html/gui/js/modules/metric_explorer/MetricExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4959,15 +4959,31 @@ Ext.extend(XDMoD.Module.MetricExplorer, XDMoD.PortalModule, {
header: 'Chart Name',
id: 'name',
dataIndex: 'name',
editor: new Ext.form.TextField({}),
renderer: function (name, metaData/* record, rowIndex, colIndex, store */) {
// if the name is (~arbitrarily) long, place it in a tooltip. This length is relative
// to the width of the GridPanel.
if (name.length > 73) {
/* eslint-disable no-param-reassign */
metaData.attr += 'ext:qtip="' + name + '"';
/* eslint-enable no-param-reassign */
}
return name;
},
sortable: true
}, {
header: 'Last Modified',
width: 180,
width: 140,
dataIndex: 'ts',
align: 'center',
renderer: function(ts, metaData, record /*, rowIndex, colIndex, store*/ ) {
var saveText = record.stack && !record.stack.isMarked() ? " - <b>Unsaved</b>" : "";
return Ext.util.Format.date(new Date(ts * 1000).toString(), 'Y-m-d H:i:s') + saveText;
// if unsaved chart record, display icon and tooltip:
if (record.stack && !record.stack.isMarked()) {
/* eslint-disable no-param-reassign */
metaData.css = 'metric-explorer-dirty-chart-record';
metaData.attr += 'ext:qtip="Unsaved Chart"';
/* eslint-enable no-param-reassign */
}
return Ext.util.Format.date(new Date(ts * 1000).toString(), 'Y-m-d H:i:s');
},
sortable: true
}], //columns
Expand Down
1 change: 1 addition & 0 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ function isReferrer($referrer)
<script type="text/javascript" src="gui/js/ContainerMask.js"></script>
<script type="text/javascript" src="gui/js/ContainerBodyMask.js"></script>

<link rel="stylesheet" type="text/css" href="gui/css/MetricExplorer.css" />
<link rel="stylesheet" type="text/css" href="gui/css/common.css" />
<!--[if lte IE 9]>
<link rel="stylesheet" type="text/css" href="gui/css/common_ie9.css" />
Expand Down