Hi

The Collapsiblock doesn´t work out of the box with a Bootstrap subtheme for me, so I would like to force the CSS Selectors (btw link to appearance settings page is not working on admin/config/user-interface/collapsiblock page (links to /adadad )

The problem is that the values set on the appearance settings page fot the CSS Selectors are not saved. Is this a bug?

Btw. shouldn´t the default values be:

Block
div.block

Title
:header:first

Block content
div.content

or are the labels wrong?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bolecha created an issue. See original summary.

tanc’s picture

Status: Active » Needs review
FileSize
1.96 KB

This should fix it. Not sure if there is a better way to let the form alter know which theme it is editing?

tanc’s picture

Some more incorrectly named variables fixed.

bolecha’s picture

#3 works for me as far as saving the Collapsiblock Selectors! Thank you, tanc.

Unfortunately the collapsiblock is not working 100% correctly.
The selected block collapse behavior is not saved :(

Block collapse behavior
0 None.
0 Collapsible, expanded by default.
x Collapsible, collapsed by default.
0 Collapsible, collapsed all the time.

The block is collapsible but is always displayed expanded on loading the page.

En Chrome Console an error is displayed:

Uncaught TypeError: $(...).find(...).size is not a function
at HTMLElement. (collapsiblock.js:92:18)
at Function.each (jquery.min.js:2:2713)
at r.fn.init.each (jquery.min.js:2:1001)
at Object.attach (collapsiblock.js:23:7)
Drupal.attachBehaviors (drupal.js:25:11)
at (drupal.init.js:16:5)
at HTMLDocument.t (ready.min.js:4:381)

collapsiblock.js 92: if (!$(this).find('a.active').size() || activePages === 1) {

Should I open a new issue?

Thank you very much for your help, tanc!

bolecha’s picture

I have substituted the size() method by the length property in collapsiblock.js (92 and 97) and it seems that the collapsiblock is working ok now.

http://api.jquery.com/size/
The .size() method is deprecated as of jQuery 1.8. Use the .length property instead.

darvanen’s picture

@bolecha, I have fixed those issues in the 8.x-2.x module, would you try that one out and open a separate issue if it persists?

  • Darvanen committed 885a36e on 8.x-1.x authored by tanc
    Issue #2946105 by tanc, bolecha: Collapsiblock Selectors are not saved
    
darvanen’s picture

Status: Needs review » Fixed

Thanks for the patch @tanc.

bolecha’s picture

Thank you very much Darvanen.

The 8.x -2.0-beta 1 module is almost working.
When I am logged in it works fine!

When I access the web as anonymous user the block is not collapsible

En Chrome Console an error is displayed:

Uncaught TypeError: $(...).once is not a function
at Object.attach (collapsiblock.js?p7sv99:12)
at drupal.js?v=8.5.3:25
at Array.forEach ()
at Object.Drupal.attachBehaviors (drupal.js?v=8.5.3:22)
at drupal.init.js?v=8.5.3:16
at HTMLDocument.t (ready.min.js?v=1.0.8:4)

(collapsiblock.js?p7sv99:12): $('.collapsiblock').once('collapsiblock').each(function () {

Should I open a new issue?

darvanen’s picture

Yes please @bolecha, that is entirely unrelated to this issue.

bolecha’s picture

Ok @Darvanen. Thank you very much for your help.

Opened new issue:

https://www.drupal.org/project/collapsiblock/issues/2966596

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.