This is an automated email from the git hooks/post-receive script. New commit to branch feature/component_choice_editor in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 1fd5df63ccbbd27f383a8c30aa80e240871457a7 Author: Kevin Morin <morin@codelutin.com> Date: Fri Mar 10 16:43:30 2017 +0100 ajout de la description --- pollen-ui-riot-js/src/main/web/i18n.json | 2 ++ pollen-ui-riot-js/src/main/web/index.js | 1 + pollen-ui-riot-js/src/main/web/js/FetchService.js | 3 -- pollen-ui-riot-js/src/main/web/js/UIHelper.js | 38 ++++++++++++++++++++++ pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html | 2 -- 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 7d7b0f8..9cbb9cb 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -228,6 +228,7 @@ "users_VALIDATION": "En cours de validation", "users_DISABLED": "Désactivé", "users_BANNED": "Banni", + "choice_description_placeholder": "Vous pouvez saisir une description", "date-picker_today": "Aujourd'hui" }, "en": { @@ -453,6 +454,7 @@ "users_VALIDATION": "Account validation", "users_DISABLED": "Account disabled", "users_BANNED": "Account banned", + "choice_description_placeholder": "You can enter a description", "date-picker_today": "Today" } } diff --git a/pollen-ui-riot-js/src/main/web/index.js b/pollen-ui-riot-js/src/main/web/index.js index dbadd47..08e2a76 100644 --- a/pollen-ui-riot-js/src/main/web/index.js +++ b/pollen-ui-riot-js/src/main/web/index.js @@ -19,6 +19,7 @@ // * #L% // */ riot.mixin(require("./js/I18nHelper")); +riot.mixin(require("./js/UIHelper")); require("./tag/Pollen.tag.html"); riot.mount("*"); diff --git a/pollen-ui-riot-js/src/main/web/js/FetchService.js b/pollen-ui-riot-js/src/main/web/js/FetchService.js index b7d4589..2c26359 100644 --- a/pollen-ui-riot-js/src/main/web/js/FetchService.js +++ b/pollen-ui-riot-js/src/main/web/js/FetchService.js @@ -101,15 +101,12 @@ class FetchService { form(url, data, doNotStringify) { let formData = null; - console.log(data); if (data) { formData = new FormData(); let keys = Object.keys(data); keys.forEach((key) => { let value = data[key]; - console.log(key); - console.log(value); if (!doNotStringify && (typeof value === "object")) { formData.set(key, JSON.stringify(value)); } else { diff --git a/pollen-ui-riot-js/src/main/web/js/UIHelper.js b/pollen-ui-riot-js/src/main/web/js/UIHelper.js new file mode 100644 index 0000000..f3808aa --- /dev/null +++ b/pollen-ui-riot-js/src/main/web/js/UIHelper.js @@ -0,0 +1,38 @@ +module.exports = { + getWindowDimensions() { + var w = window, + d = document, + e = d.documentElement, + g = d.getElementsByTagName("body")[0], + x = w.innerWidth || e.clientWidth || g.clientWidth, + y = w.innerHeight || e.clientHeight || g.clientHeight; + return { width: x, height: y }; + }, + + positionDropdown(selector, visible) { + const w = this.getWindowDimensions(); + const m = this.root.querySelector(selector); + if (!m) { + return; + } + if (!visible) { + // Reset position + m.style.marginTop = ""; + m.style.marginLeft = ""; + return; + } + const pos = m.getBoundingClientRect(); + if (w.width < pos.left + pos.width) { + // menu is off the right hand of the page + m.style.marginLeft = (w.width - (pos.left + pos.width) - 20) + "px"; + } + if (pos.left < 0) { + // menu is off the right hand of the page + m.style.marginLeft = "20px"; + } + if (w.height < pos.top + pos.height) { + // Popup is off the bottom of the page + m.style.marginTop = (w.height - (pos.top + pos.height) - 20) + "px"; + } + } +}; diff --git a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html index c57b37d..9075e83 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html @@ -35,8 +35,6 @@ require("./Users.tag.html"); <script type="es6"> let session = require("../js/Session"); - - session.start().then(() => { // console.info("session started"); }); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.