icon -> cssClass

This commit is contained in:
Even Stensberg 2017-11-21 19:44:05 +01:00 committed by Pete Richards
parent 9506d309b0
commit 91b150c064
3 changed files with 8 additions and 8 deletions

4
API.md
View File

@ -882,13 +882,13 @@ openmct.install(openmct.plugins.CouchDB('http://localhost:9200'))
* `openmct.plugins.URLIndicatorPlugin` adds an indicator which shows the
availability of a URL with the following options:
- `url` : URL to indicate the status of
- `icon`: Icon to show in the status bar, defaults to `database`
- `cssClass`: Icon to show in the status bar, defaults to `icon-database`, [list of all icons](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home?view=items)
- `interval`: Interval between checking the connection, defaults to `10000`
- `label` Name showing up as text in the status bar, defaults to url
```javascript
openmct.install(openmct.plugins.URLIndicatorPlugin({
url: 'http://google.com',
icon: 'check',
cssClass: 'check',
interval: 10000,
label: 'Google'
})

View File

@ -40,7 +40,7 @@ define(
};
function URLIndicator($http, $interval) {
var self = this;
this.icon = "icon-" + (this.options.icon ? this.options.icon : "database");
this.cssClass = this.options.cssClass ? this.options.cssClass : "icon-database";
this.URLpath = this.options.url;
this.label = this.options.label ? this.options.label : this.options.url;
this.interval = this.options.interval || 10000;
@ -60,7 +60,7 @@ define(
}
URLIndicator.prototype.getCssClass = function () {
return this.icon;
return this.cssClass;
};
URLIndicator.prototype.getGlyphClass = function () {
return this.state.glyphClass;

View File

@ -57,7 +57,7 @@ define(
);
});
it("has a database icon as default", function () {
it("has a database cssClass as default", function () {
expect(indicatorWrapper.getCssClass()).toEqual("icon-database");
});
@ -102,14 +102,14 @@ define(
// Do check for specific class
expect(indicatorWrapper.getGlyphClass()).toEqual("err");
});
it("has a customized icon if supplied in initialization", function () {
it("has a customized cssClass if supplied in initialization", function () {
opts = {
url: "http://localhost:8080",
icon: "checked",
cssClass: "cssClass-checked",
interval: 10000
};
indicatorWrapper = new Indicator();
expect(indicatorWrapper.getCssClass()).toEqual("icon-checked");
expect(indicatorWrapper.getCssClass()).toEqual("cssClass-checked");
});
it("has a customized interval if supplied in initialization", function () {
opts = {