Updated to newer versions of Floorplan.

pull/502/head
ccostan 8 years ago
parent a7a9d170f2
commit 3cb120585d

@ -80,6 +80,20 @@ http:
frontend: frontend:
javascript_version: latest javascript_version: latest
# panel_iframe:
# pihole:
# title: 'Pi-Hole'
# url: 'http://pi.hole/admin'
# icon: mdi:block-helper
# unifi:
# title: 'Unifi'
# url: 'https://192.168.10.10:8443/manage'
# icon: mdi:access-point-network
# docker:
# title: 'Docker'
# url: 'https://192.168.10.10:9090/docker'
# icon: mdi:docker
panel_custom: panel_custom:
- name: floorplan - name: floorplan
sidebar_title: Alarm Panel sidebar_title: Alarm Panel

@ -1,11 +1,11 @@
<!-- <!--
Floorplan for Home Assistant Floorplan for Home Assistant
Version: 1.0.7.51 Version: 1.0.8.3
By Petar Kozul By Petar Kozul
https://github.com/pkozul/ha-floorplan https://github.com/pkozul/ha-floorplan
--> -->
<script src="lib/jquery-3.2.1.min.js"></script> <script src="lib/jquery-3.3.1.min.js"></script>
<script src="lib/moment.min.js"></script> <script src="lib/moment.min.js"></script>
<script src="lib/yaml.min.js"></script> <script src="lib/yaml.min.js"></script>
@ -79,7 +79,7 @@
</dom-module> </dom-module>
<script> <script>
class HaFloorplan extends window.hassMixins.EventsMixin(Polymer.Element) { class HaFloorplan extends Polymer.Element {
static get is() { return 'ha-floorplan'; } static get is() { return 'ha-floorplan'; }
static get properties() { static get properties() {
@ -113,7 +113,9 @@
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
this.initFloorplan(); if (!this.floorplan) {
this.initFloorplan();
}
} }
stopPropagation(e) { stopPropagation(e) {
@ -126,7 +128,7 @@
this.floorplan = new Floorplan(); this.floorplan = new Floorplan();
let options = { let options = {
doc: Polymer.dom(this.root).node, doc: this.root,
hass: this.hass, hass: this.hass,
openMoreInfo: this.openMoreInfo.bind(this), openMoreInfo: this.openMoreInfo.bind(this),
setIsLoading: this.setIsLoading.bind(this), setIsLoading: this.setIsLoading.bind(this),
@ -161,7 +163,7 @@
reject(new URIError(`${err.target.src}`)); reject(new URIError(`${err.target.src}`));
}; };
Polymer.dom(this.root).node.appendChild(script); this.root.appendChild(script);
}); });
} }
@ -180,10 +182,24 @@
logError(message) { logError(message) {
console.error(message); console.error(message);
let log = Polymer.dom(this.$.log).node; let log = this.root.log;
$(log).find('ul').prepend(`<li class="error">${message}</li>`) $(log).find('ul').prepend(`<li class="error">${message}</li>`)
$(log).css('display', 'block'); $(log).css('display', 'block');
} }
fire(type, detail, options) {
options = options || {};
detail = (detail === null || detail === undefined) ? {} : detail;
const event = new Event(type, {
bubbles: options.bubbles === undefined ? true : options.bubbles,
cancelable: Boolean(options.cancelable),
composed: options.composed === undefined ? true : options.composed
});
event.detail = detail;
const node = options.node || this;
node.dispatchEvent(event);
return event;
}
} }
customElements.define(HaFloorplan.is, HaFloorplan); customElements.define(HaFloorplan.is, HaFloorplan);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save

Powered by TurnKey Linux.