| 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/pull-to-refresh/ |
Upload File : |
import $ from '../../shared/dom7.js';
import { extend } from '../../shared/utils.js';
import PullToRefresh from './pull-to-refresh-class.js';
import ConstructorMethods from '../../shared/constructor-methods.js';
export default {
name: 'pullToRefresh',
create() {
const app = this;
app.ptr = extend(ConstructorMethods({
defaultSelector: '.ptr-content',
constructor: PullToRefresh,
app,
domProp: 'f7PullToRefresh'
}), {
done(el) {
const ptr = app.ptr.get(el);
if (ptr) return ptr.done();
return undefined;
},
refresh(el) {
const ptr = app.ptr.get(el);
if (ptr) return ptr.refresh();
return undefined;
}
});
},
static: {
PullToRefresh
},
on: {
tabMounted(tabEl) {
const app = this;
const $tabEl = $(tabEl);
const $ptrEls = $tabEl.find('.ptr-content');
if ($tabEl.is('.ptr-content')) $ptrEls.add($tabEl);
$ptrEls.each(el => {
app.ptr.create(el);
});
},
tabBeforeRemove(tabEl) {
const $tabEl = $(tabEl);
const app = this;
const $ptrEls = $tabEl.find('.ptr-content');
if ($tabEl.is('.ptr-content')) $ptrEls.add($tabEl);
$ptrEls.each(el => {
app.ptr.destroy(el);
});
},
pageInit(page) {
const app = this;
page.$el.find('.ptr-content').each(el => {
app.ptr.create(el);
});
},
pageBeforeRemove(page) {
const app = this;
page.$el.find('.ptr-content').each(el => {
app.ptr.destroy(el);
});
}
}
};