Skip to content

Commit 03433d1

Browse files
author
Konstantin
authored
4.0.1
* Read & use pre-upgrade state of the html, href, model attributes #30 * Update juicy-html.html * 4.0.1 * Update juicy-html.html
1 parent 393629c commit 03433d1

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "juicy-html",
33
"description": "A custom element that lets you load HTML partials into your Web page. Declarative way for client-side includes.",
4-
"version": "4.0.0",
4+
"version": "4.0.1",
55
"homepage": "https://github.com/Juicy/juicy-html",
66
"authors": [
77
"Joachim Wester <joachimwester@me.com>",

juicy-html.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(c) 2013-2015 Juicy
44
MIT license
55
https://github.com/Juicy/juicy-html
6-
version: 4.0.0
6+
version: 4.0.1
77
-->
88
<script>
99
(function() {
@@ -22,7 +22,10 @@
2222
}
2323
constructor(self) {
2424
self = super(self);
25-
var model = null; // XXX(tomalec): || this.model ? // to consider for https://github.com/Juicy/juicy-html/issues/30
25+
26+
// Idea: Handle pre-upgrade state
27+
// https://github.com/Juicy/juicy-html/issues/30
28+
var model = this.model || null;
2629
Object.defineProperties(this, {
2730
'model': {
2831
set: function(newValue) {
@@ -64,9 +67,14 @@
6467
// it does not give exactly the same behavior, but hopefully nobody would like to make it block.
6568
this.style.display = 'none';
6669
// autostamp
67-
// TODO(tomalec): read pre-upgrade properties in cheap manner
68-
this.hasAttribute('href') && this.attributeChangedCallback('href', null, this.getAttribute('href'));
69-
this.hasAttribute('html') && this.attributeChangedCallback('html', null, this.getAttribute('html'));
70+
71+
if (this.href || this.hasAttribute('href')) {
72+
this.attributeChangedCallback('href', null, this.href || this.getAttribute('href'));
73+
}
74+
75+
if (this.html || this.hasAttribute('html')) {
76+
this.attributeChangedCallback('html', null, this.html || this.getAttribute('html'));
77+
}
7078
}
7179
disconnectedCallback() {
7280
this.isAttached = false;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "juicy-html",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "A custom element that lets you load HTML partials into your Web page. Declarative way for client-side includes.",
55
"homepage": "https://github.com/Juicy/juicy-html",
66
"repository": {

0 commit comments

Comments
 (0)