NPM Resource Changed ? Success

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
16 Mar 2019

Summary of Changes

While updating The TinyMCE I stumbled over this function. The function disables/enables options, so user levels can only be selected only once.

For fancy select there is no native option to disable/enable options and it's complex to do this. So this PR adds a short hand.

Testing Instructions

fancyselect.disableByValue("2");
fancyselect.enableByValue("2");
fancyselect.disableAllOptions();
fancyselect.enableAllOptions();

@HLeithner

avatar bembelimen bembelimen - open - 16 Mar 2019
avatar bembelimen bembelimen - change - 16 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Mar 2019
Category JavaScript Repository NPM Change
avatar bembelimen bembelimen - change - 16 Mar 2019
The description was changed
avatar bembelimen bembelimen - edited - 16 Mar 2019
avatar ghazal
ghazal - comment - 17 Mar 2019

I guess (suggest) choices.js should be updated. We are using version 3.0.4 while it's been updated up to 6.0.3.
But fancy select has to be modified accordingly.

With choices v.6.0.3 (and our actual fancy select), select is working - well in a fashion, it's not displaying the drop-down.
Input of a new tag is not.
I have been wondering if this was related to a change in 4.1.0
"A Choices input will now be disabled when loading remote data and will be enabled once the data has loaded."

avatar ghazal
ghazal - comment - 17 Mar 2019

This change tested with choices v 6.0.3, same pb.
I didn't post this on issue tracker because it's not related to the fancy select file used now.

avatar bembelimen
bembelimen - comment - 17 Mar 2019

@ghazal thanks for your input. I guess there is no "option disable"-method in the latest version either?

But using the latest version makes sense. I'll look into it, after this PR is merged.

avatar bembelimen bembelimen - change - 17 Mar 2019
Labels Added: NPM Resource Changed ?
avatar ghazal
ghazal - comment - 23 Mar 2019
  • error in NPM,

custom-event-polyfill not accessible from choices.js

I guess it's because these new requirements by choices.js v 6.0.3 not added in package-lock.json
"custom-event-polyfill": "^0.3.0",
"deepmerge": "^2.2.1"

In build/build-modules-js/settings.json, paths not correct.
When I get choicesjs v 6.0.3 via NPM, I get these new paths:


      "choices.js": {
        "name": "choicesjs",
        "js": {
          "public/assets/scripts/choices.js": "js/choices.js",
          "public/assets/scripts/choices.min.js": "js/choices.min.js"
        },
        "css": {
          "public/assets/styles/choices.css": "css/choices.css",
          "public/assets/styles/choices.min.css": "css/choices.min.css"
        },
avatar bembelimen
bembelimen - comment - 23 Mar 2019

Hi @ghazal thanks for your feedback, but the paths are equal to yours: https://github.com/joomla/joomla-cms/pull/24211/files#diff-185f265f952db15b3bbc2bf2a06f0fc4

custom-event-polyfill not accessible from choices.js

When do you get this error? I can't reproduce it.

https://github.com/joomla/joomla-cms/pull/24211/files#diff-32607347f8126e6534ebc7ebaec4853dR1886

avatar ghazal
ghazal - comment - 24 Mar 2019

@bembelimen
I clone your fork with git
git clone --depth=1 -b fancy-select-option https://github.com/bembelimen/joomla-cms/

*as of today, npm works fine since the 2 libs (deepmerge and custom-event-polyfill) has been added to package-lock.json

  • there is a typo in fancy select - the dev of choices.js had modified it in his choices script.
    this.choicesInstance.presetChoices this.choicesInstance._presetChoices
    line 1767

  • a "paste" event is missing in fancy select when checking event with the Firefox Inspector.
    In choices.js , it's in key addEventListeners (and in key removeEventListeners)

Hope it helps.

avatar bembelimen
bembelimen - comment - 24 Mar 2019

Hope it helps.

Definitely, thanks for that.

Just saw the error last night :)

I have to extend the additional disable stuff with some more checks, the Choice.js misses a good API... I'm working on it.

avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Category JavaScript Repository NPM Change JavaScript Repository
avatar bembelimen bembelimen - change - 13 Apr 2019
Labels Removed: J4 Issue
avatar joomla-cms-bot joomla-cms-bot - change - 13 Apr 2019
Category JavaScript Repository Repository JavaScript NPM Change
avatar bembelimen bembelimen - change - 13 Apr 2019
The description was changed
avatar bembelimen bembelimen - edited - 13 Apr 2019
avatar HLeithner HLeithner - change - 16 Apr 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-04-16 16:19:34
Closed_By HLeithner
avatar HLeithner HLeithner - close - 16 Apr 2019
avatar HLeithner HLeithner - merge - 16 Apr 2019
avatar HLeithner
HLeithner - comment - 16 Apr 2019

thx

Add a Comment

Login with GitHub to post a comment