| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/framework7/node_modules/framework7/components/toggle/ |
Upload File : |
import $ from '../../shared/dom7.js';
import ConstructorMethods from '../../shared/constructor-methods.js';
import Toggle from './toggle-class.js';
export default {
name: 'toggle',
create() {
const app = this;
app.toggle = ConstructorMethods({
defaultSelector: '.toggle',
constructor: Toggle,
app,
domProp: 'f7Toggle'
});
},
static: {
Toggle
},
on: {
tabMounted(tabEl) {
const app = this;
$(tabEl).find('.toggle-init').each(toggleEl => app.toggle.create({
el: toggleEl
}));
},
tabBeforeRemove(tabEl) {
$(tabEl).find('.toggle-init').each(toggleEl => {
if (toggleEl.f7Toggle) toggleEl.f7Toggle.destroy();
});
},
pageInit(page) {
const app = this;
page.$el.find('.toggle-init').each(toggleEl => app.toggle.create({
el: toggleEl
}));
},
pageBeforeRemove(page) {
page.$el.find('.toggle-init').each(toggleEl => {
if (toggleEl.f7Toggle) toggleEl.f7Toggle.destroy();
});
}
},
vnode: {
'toggle-init': {
insert(vnode) {
const app = this;
const toggleEl = vnode.elm;
app.toggle.create({
el: toggleEl
});
},
destroy(vnode) {
const toggleEl = vnode.elm;
if (toggleEl.f7Toggle) toggleEl.f7Toggle.destroy();
}
}
}
};