@webhandle/backbone-view 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-js/view.js +4 -0
- package/package.json +2 -2
package/client-js/view.js
CHANGED
|
@@ -96,6 +96,7 @@ export class View {
|
|
|
96
96
|
*/
|
|
97
97
|
_createElement(name) {
|
|
98
98
|
let el = document.createElement(name)
|
|
99
|
+
el.setAttribute('id', this.id)
|
|
99
100
|
el.view = this
|
|
100
101
|
return el
|
|
101
102
|
}
|
|
@@ -108,6 +109,9 @@ export class View {
|
|
|
108
109
|
if (!this.el) {
|
|
109
110
|
this.setElement(this._createElement(this.tagName))
|
|
110
111
|
}
|
|
112
|
+
else {
|
|
113
|
+
this._addListeners()
|
|
114
|
+
}
|
|
111
115
|
this._setAttributes()
|
|
112
116
|
if (this.className) {
|
|
113
117
|
this.el.classList.add(this.className)
|