Move getProp and setProp to common.js

This commit is contained in:
Alex Ling
2020-12-11 09:46:56 +00:00
parent 280490fb36
commit dad02a2a30
4 changed files with 24 additions and 44 deletions

View File

@@ -61,28 +61,6 @@ const updateMode = (mode, targetPage) => {
});
};
/**
* Set an alpine.js property
*
* @function setProp
* @param {string} key - Key of the data property
* @param {*} prop - The data property
*/
const setProp = (key, prop) => {
$('#root').get(0).__x.$data[key] = prop;
};
/**
* Get an alpine.js property
*
* @function getProp
* @param {string} key - Key of the data property
* @return {*} The data property
*/
const getProp = (key) => {
return $('#root').get(0).__x.$data[key];
};
/**
* Get dimension of the pages in the entry from the API and update the view
*/