@kohanajs/mod-cms
Advanced tools
Comparing version 7.1.0 to 7.1.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [7.1.1](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v7.1.0...v7.1.1) (2022-04-07) | ||
### Bug Fixes | ||
* sorting blocks and items ([9a4389a](https://gitlab.com/kohana-js/proposals/level0/mod-cms/commit/9a4389ac9568c3a8b01575210375319877c79877)) | ||
## [7.1.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v7.0.2...v7.1.0) (2022-03-24) | ||
@@ -7,0 +14,0 @@ |
@@ -106,2 +106,20 @@ const { ControllerAdmin } = require('@kohanajs/mod-admin'); | ||
//assign item index as item key | ||
Object.keys(page.print.tokens).forEach(token =>{ | ||
if(Array.isArray(page.print.tokens[token])){ | ||
page.print.tokens[token].forEach((it, i) => it._key = i); | ||
} | ||
}) | ||
//assign block index as block key, block item index as block item key | ||
page.print.blocks.forEach((block, i) =>{ | ||
block._weight = block.tokens._weight; | ||
block._key ||= i; | ||
Object.keys(block.tokens).forEach(token => { | ||
if(Array.isArray(block.tokens[token])){ | ||
block.tokens[token].forEach((it, i) => it._key = i); | ||
} | ||
}) | ||
}) | ||
templateData.tokens = page.print.tokens; | ||
@@ -207,3 +225,3 @@ templateData.blocks = page.print.blocks; | ||
defaultItem.attributes._weight = original.items[itemName].length || 1; | ||
defaultItem.attributes._weight = original.items[itemName].length; | ||
original.items[itemName].push(defaultItem); | ||
@@ -210,0 +228,0 @@ |
{ | ||
"name": "@kohanajs/mod-cms", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "The CMS module for KohanaJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94911
1261