click on img on material card open the ModalCard, not the coollightbox #992
This commit is contained in:
parent
64dadbccf0
commit
a3dd424289
|
@ -946,7 +946,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
||||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nvar _cardMixins = _interopRequireDefault(__webpack_require__(/*! vuejs/components/cardMixins */ \"./web/themes/custom/materiotheme/vuejs/components/cardMixins.js\"));\n\nvar _ModalCard = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/ModalCard */ \"./web/themes/custom/materiotheme/vuejs/components/Content/ModalCard.vue\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Card\",\n props: ['item'],\n mixins: [_cardMixins.default],\n components: {\n ModalCard: _ModalCard.default\n },\n data: function data() {\n return {\n blanksrc: \"\".concat(drupalSettings.path.themePath, \"/assets/img/blank.gif\"),\n loadingFlag: false,\n lightbox_index: null\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n flagcolls: function flagcolls(state) {\n return state.User.flagcolls;\n },\n isloggedin: function isloggedin(state) {\n return state.User.isloggedin;\n }\n })),\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n flagUnflag: 'User/flagUnflag'\n })), {}, {\n flagIsActive: function flagIsActive(collid) {\n // console.log(\"Card flagIsActive\",\n // this.item.id,\n // this.flagcolls[collid].items,\n // this.flagcolls[collid].items.indexOf(this.item.id)\n // );\n // console.log(this.flagcolls[collid].items_uuids);\n // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;\n return this.flagcolls[collid].items.indexOf(this.item.id) !== -1;\n },\n flagIsLoading: function flagIsLoading(collid) {\n // console.log(this.item.uuid);\n // console.log(this.flagcolls[collid].items_uuids);\n return collid === this.loadingFlag;\n },\n onFlagActionCard: function onFlagActionCard(e) {\n var _this = this;\n\n console.log(\"Card onFlagActionCard\", e, this.item);\n\n if (!this.loadingFlag) {\n var collid = e.target.getAttribute('collid');\n var isActive = this.flagIsActive(collid);\n var action = isActive ? 'unflag' : 'flag'; // console.log('collid', collid);\n // console.log(\"this.item\", this.item);\n\n this.loadingFlag = collid;\n this.flagUnflag({\n action: action,\n id: this.item.id,\n collid: collid\n }).then(function (data) {\n console.log(\"onFlagActionCard then\", data);\n _this.loadingFlag = false;\n });\n }\n },\n openModalCard: function openModalCard(e) {\n console.log('openModalCard', this.isLoggedin);\n\n if (this.isloggedin) {\n this.$modal.show(_ModalCard.default, {\n item: this.item\n }, {\n draggable: true,\n width: '850px',\n height: '610px'\n });\n }\n }\n })\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nvar _cardMixins = _interopRequireDefault(__webpack_require__(/*! vuejs/components/cardMixins */ \"./web/themes/custom/materiotheme/vuejs/components/cardMixins.js\"));\n\nvar _ModalCard = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/ModalCard */ \"./web/themes/custom/materiotheme/vuejs/components/Content/ModalCard.vue\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Card\",\n props: ['item'],\n mixins: [_cardMixins.default],\n components: {\n ModalCard: _ModalCard.default\n },\n data: function data() {\n return {\n blanksrc: \"\".concat(drupalSettings.path.themePath, \"/assets/img/blank.gif\"),\n loadingFlag: false // lightbox_index: null\n\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n flagcolls: function flagcolls(state) {\n return state.User.flagcolls;\n },\n isloggedin: function isloggedin(state) {\n return state.User.isloggedin;\n }\n })),\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n flagUnflag: 'User/flagUnflag'\n })), {}, {\n flagIsActive: function flagIsActive(collid) {\n // console.log(\"Card flagIsActive\",\n // this.item.id,\n // this.flagcolls[collid].items,\n // this.flagcolls[collid].items.indexOf(this.item.id)\n // );\n // console.log(this.flagcolls[collid].items_uuids);\n // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;\n return this.flagcolls[collid].items.indexOf(this.item.id) !== -1;\n },\n flagIsLoading: function flagIsLoading(collid) {\n // console.log(this.item.uuid);\n // console.log(this.flagcolls[collid].items_uuids);\n return collid === this.loadingFlag;\n },\n onFlagActionCard: function onFlagActionCard(e) {\n var _this = this;\n\n console.log(\"Card onFlagActionCard\", e, this.item);\n\n if (!this.loadingFlag) {\n var collid = e.target.getAttribute('collid');\n var isActive = this.flagIsActive(collid);\n var action = isActive ? 'unflag' : 'flag'; // console.log('collid', collid);\n // console.log(\"this.item\", this.item);\n\n this.loadingFlag = collid;\n this.flagUnflag({\n action: action,\n id: this.item.id,\n collid: collid\n }).then(function (data) {\n console.log(\"onFlagActionCard then\", data);\n _this.loadingFlag = false;\n });\n }\n },\n // onClickImg (e, index) {\n // this.lightbox_index = index\n // },\n openModalCard: function openModalCard(e) {\n console.log('openModalCard', this.isLoggedin);\n\n if (this.isloggedin) {\n this.$modal.show(_ModalCard.default, {\n item: this.item\n }, {\n draggable: true,\n width: '850px',\n height: '610px'\n });\n }\n }\n })\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
@ -3143,7 +3143,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
||||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"article\",\n { staticClass: \"card search-card\" },\n [\n _c(\"header\", { on: { click: _vm.openModalCard } }, [\n _vm.isloggedin ? _c(\"h1\", [_vm._v(_vm._s(_vm.item.title))]) : _vm._e(),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.item.short_description))]),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.item.reference))\n ])\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"images\"\n },\n _vm._l(_vm.item.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: { \"data-src\": img.style_cardmedium_url, title: img.title }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n _vm.lightbox_index = index\n }\n }\n })\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.item.images,\n index: _vm.lightbox_index,\n srcName: \"style_hd_url\",\n loop: true\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n })\n : _vm._e()\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"article\", { staticClass: \"card search-card\" }, [\n _c(\n \"header\",\n {\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.openModalCard($event)\n }\n }\n },\n [\n _vm.isloggedin ? _c(\"h1\", [_vm._v(_vm._s(_vm.item.title))]) : _vm._e(),\n _vm._v(\" \"),\n _c(\"h4\", [_vm._v(_vm._s(_vm.item.short_description))]),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"span\", { staticClass: \"ref\" }, [\n _vm._v(_vm._s(_vm.item.reference))\n ])\n : _vm._e()\n ]\n ),\n _vm._v(\" \"),\n _vm.isloggedin\n ? _c(\"nav\", { staticClass: \"tools\" }, [\n _c(\"section\", { staticClass: \"tool flags\" }, [\n _c(\"span\", { staticClass: \"btn mdi mdi-folder-outline\" }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tool-content\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.flagcolls, function(coll) {\n return _vm.flagcolls\n ? _c(\"li\", { key: coll.id }, [\n _c(\n \"span\",\n {\n staticClass: \"flag mdi\",\n class: [\n _vm.flagIsLoading(coll.id)\n ? \"mdi-loading mdi-spin\"\n : _vm.flagIsActive(coll.id)\n ? \"mdi-close-circle isActive\"\n : \"mdi-plus\"\n ],\n attrs: { collid: coll.id },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onFlagActionCard($event)\n }\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(coll.name) +\n \"\\n \"\n )\n ]\n )\n ])\n : _vm._e()\n }),\n 0\n )\n ])\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"section\",\n {\n directives: [{ name: \"switcher\", rawName: \"v-switcher\" }],\n staticClass: \"images\"\n },\n _vm._l(_vm.item.images, function(img, index) {\n return _c(\"figure\", { key: img.url }, [\n _c(\"img\", {\n directives: [\n {\n name: \"lazy\",\n rawName: \"v-lazy\",\n value: index,\n expression: \"index\"\n }\n ],\n staticClass: \"lazy\",\n attrs: { \"data-src\": img.style_cardmedium_url, title: img.title }\n }),\n _vm._v(\" \"),\n _c(\"img\", {\n staticClass: \"blank\",\n attrs: { src: _vm.blanksrc },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.openModalCard($event)\n }\n }\n })\n ])\n }),\n 0\n )\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<article class="card search-card">
|
<article class="card search-card">
|
||||||
<header
|
<header
|
||||||
@click="openModalCard"
|
@click.prevent="openModalCard"
|
||||||
>
|
>
|
||||||
<h1 v-if="isloggedin">{{ item.title }}</h1>
|
<h1 v-if="isloggedin">{{ item.title }}</h1>
|
||||||
<h4>{{ item.short_description }}</h4>
|
<h4>{{ item.short_description }}</h4>
|
||||||
|
@ -42,18 +42,18 @@
|
||||||
<img
|
<img
|
||||||
class="blank"
|
class="blank"
|
||||||
:src="blanksrc"
|
:src="blanksrc"
|
||||||
@click="lightbox_index = index"
|
@click.prevent="openModalCard"
|
||||||
>
|
>
|
||||||
</figure>
|
</figure>
|
||||||
</section>
|
</section>
|
||||||
<CoolLightBox
|
<!-- <CoolLightBox
|
||||||
v-if="isloggedin"
|
v-if="isloggedin"
|
||||||
:items="item.images"
|
:items="item.images"
|
||||||
:index="lightbox_index"
|
:index="lightbox_index"
|
||||||
srcName="style_hd_url"
|
srcName="style_hd_url"
|
||||||
:loop="true"
|
:loop="true"
|
||||||
@close="lightbox_index = null">
|
@close="lightbox_index = null">
|
||||||
</CoolLightBox>
|
</CoolLightBox> -->
|
||||||
</article>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,
|
blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,
|
||||||
loadingFlag: false,
|
loadingFlag: false
|
||||||
lightbox_index: null
|
// lightbox_index: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -117,6 +117,9 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// onClickImg (e, index) {
|
||||||
|
// this.lightbox_index = index
|
||||||
|
// },
|
||||||
openModalCard (e) {
|
openModalCard (e) {
|
||||||
console.log('openModalCard', this.isLoggedin);
|
console.log('openModalCard', this.isLoggedin);
|
||||||
if(this.isloggedin){
|
if(this.isloggedin){
|
||||||
|
|
Loading…
Reference in New Issue