diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f627b6..dcce9c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.1.10](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.9...v1.1.10) (2022-12-04) + + +### Bug Fixes + +* bump dependencies ([a70f719](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a70f719e506637e3f9377a7706460b148289e666)) +* improve parse and save attribute ([e8ca38e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e8ca38ebd02cbe2ed9695fd64d8c7be46ef037eb)) + ## [1.1.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.8...v1.1.9) (2022-12-02) diff --git a/package.json b/package.json index 159907f..f0a5956 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cocreate/css-parser", - "version": "1.1.9", + "version": "1.1.10", "description": "A simple css-parser component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.", "keywords": [ "css-parser", @@ -61,9 +61,9 @@ "webpack-log": "^3.0.1" }, "dependencies": { - "@cocreate/crud-client": "^1.15.10", - "@cocreate/docs": "^1.4.11", - "@cocreate/hosting": "^1.6.9", - "@cocreate/observer": "^1.5.32" + "@cocreate/crud-client": "^1.15.12", + "@cocreate/docs": "^1.4.13", + "@cocreate/hosting": "^1.6.11", + "@cocreate/observer": "^1.5.33" } } diff --git a/src/index.js b/src/index.js index 5e3db27..a9087fe 100644 --- a/src/index.js +++ b/src/index.js @@ -26,12 +26,12 @@ let linkCSS = []; let themeCSS = { dark: [], light: [] }; let styleElSheet; -let linkTag = document.querySelector('link[collection][document_id][name]:not([save="false"])'); +let linkTag = document.querySelector('link[parse], link[collection][document_id][name]'); +// let linkTag = document.querySelector('link[collection][document_id][name]:not([save="false"])'); function init() { - let parse; if (linkTag) { - parse = linkTag.getAttribute('parse'); + let parse = linkTag.getAttribute('parse'); let styleEl = document.createElement("style"); styleEl.setAttribute('component', 'CoCreateCss'); @@ -40,7 +40,7 @@ function init() { parseLinkCSS(); - if (parse != false) { + if (parse != 'false') { let elements = document.querySelectorAll("[class]"); initElements(elements); } @@ -264,7 +264,7 @@ function addNewRules() { } function save() { - if (linkTag && linkTag.hasAttribute('document_id')) { + if (linkTag && linkTag.hasAttribute('document_id') && linkTag.getAttribute(save) != 'false') { const onlyUnique = (value, index, self) => { return self.indexOf(value) === index; };