terminal42 / contao-dcawizard

A Contao CMS widget to handle external table records in the edit mode of the parent record.
10 stars 10 forks source link

DCA Wizard doesn't hide 'Go Back' Button when listing is empty #3

Closed pfiaux closed 11 years ago

pfiaux commented 11 years ago

When there's entries listed in the table dcawizard.js has code to hide the back button, but not when editing a child (so we have the option to go back to the list). This however doesn't work when the list is empty. It allows the user to hit go back and then the parent table is displayed inside of it's edit view which is odd.

// Line 278 current version src
var hideBackButton = $defined(this.element.getElement('.tl_listing_container'));

This is because when the table's empty it doesn't have a div.tl_listing_container but a div.tl_empty. Checking for that too mostly solved the problem for me:

// This would work:
var hideBackButton = $defined(this.element.getElement('.tl_listing_container')) || $defined(this.element.getElement('.tl_empty'));
Toflar commented 11 years ago

We won't support versions prior to Contao 3.1.* anymore :)