Skip to content

Commit

Permalink
Merge branch 'master' into jquery-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
bkalaldeh committed Oct 23, 2023
2 parents 49e0681 + e59955b commit 34f2d71
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
40 changes: 19 additions & 21 deletions scripts/buildfire/components/[email protected]/listView.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
if (typeof buildfire == 'undefined') throw 'please add buildfire.js first to use buildfire components';
if (typeof buildfire.components == 'undefined') buildfire.components = {};

function State() {
this.listViewSearchBarContainer = null;
this.listViewItemsContainer = null;
this.searchValue = null;
this.page = null;
this.fetchNextPage = true;
this.contentMappingDefault = {
idKey: 'id',
imageKey: 'imageUrl',
titleKey: 'title',
subtitleKey: 'subtitle',
descriptionKey: 'description'
};
this.paginationOptions = {
page: 0,
pageSize: 10
};
this.busy = false;
}

buildfire.components.listView = class ListView {
constructor(selector, options = {}) {
if (!document.querySelector(selector)) throw new Error('Element not found!');
Expand All @@ -45,7 +25,25 @@ buildfire.components.listView = class ListView {
searchInputPlaceholder: 'Search'
},
};
this._state = new State();
this._state = {
listViewSearchBarContainer: null,
listViewItemsContainer: null,
searchValue: null,
page: null,
fetchNextPage: true,
contentMappingDefault: {
idKey: 'id',
imageKey: 'imageUrl',
titleKey: 'title',
subtitleKey: 'subtitle',
descriptionKey: 'description'
},
paginationOptions: {
page: 0,
pageSize: 10
},
busy: false,
};
this.options.settings = options.settings ? Object.assign(this.options.settings, options.settings) : this.options.settings;
this.options.translations = options.translations ? Object.assign(this.options.translations, options.translations) : this.options.translations;
this.options.settings.contentMapping = options.settings && options.settings.contentMapping ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ buildfire.components.swipeableDrawer = {
_swipeableDrawerState.header = content;
_swipeableDrawerElements.drawerHeaderContent.classList.remove('swipeable-drawer-hidden');
_swipeableDrawerUtils.setContent(_swipeableDrawerElements.drawerHeaderContent, content);
if (_swipeableDrawerState.startingStep === 'min')
_swipeableDrawerUtils.reset();
},
setFooterContent(content) {
_swipeableDrawerState.footer = content;
Expand Down

0 comments on commit 34f2d71

Please sign in to comment.