Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made it possible to add non-grid items under the isotope element. #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions dist/vue_isotope.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,24 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
};

var isotopeComponent = {
name: 'isotope',

props: props,

render: function render(h) {
var _this = this;

var map = {};
var prevChildren = this.prevChildren = this.children;
var rawChildren = this.$slots.default || [];
var children = this.children = [];
var removedIndex = this.removedIndex = [];

rawChildren.forEach(function (elt) {
return addClass(elt, _this.itemSelector);
});

for (var i = 0; i < rawChildren.length; i++) {
var c = rawChildren[i];
if (c.tag) {
if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
if (c.key !== '$ignore') {
addClass(c, this.itemSelector);
}
children.push(c);
map[c.key] = c;
} else {
Expand Down Expand Up @@ -94,12 +93,12 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
};
update(options.getSortData);
update(options.getFilterData);
this._isotopeOptions = options;
if (options.filter) {
options.filter = this.buildFilterFunction(options.filter);
}

this.$nextTick(function () {
_this2._isotopeOptions = options;
_this2.link();
_this2.listen();
var iso = new Isotope(_this2.$el, options);
Expand Down Expand Up @@ -262,7 +261,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
return isotopeComponent;
}

if (typeof exports == "object") {
if (typeof exports === "object") {
var _ = require("lodash"),
Isotope = require("isotope-layout");
module.exports = buildVueIsotope(_, Isotope);
Expand All @@ -274,4 +273,4 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
var isotope = buildVueIsotope(window._, window.Isotope);
Vue.component('isotope', isotope);
}
})();
})();
2 changes: 1 addition & 1 deletion dist/vue_isotope.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/vue_isotope.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@
const children = this.children = []
const removedIndex = this.removedIndex = []

rawChildren.forEach(elt => addClass(elt, this.itemSelector))

for (let i = 0; i < rawChildren.length; i++) {
const c = rawChildren[i]
if (c.tag) {
if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
children.push(c)
map[c.key] = c
if (c.key !== '$ignore') {
addClass(c, _this.itemSelector)
}
children.push(c);
map[c.key] = c;
} else {
const opts = c.componentOptions
const name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag
Expand Down