calx.js icon indicating copy to clipboard operation
calx.js copied to clipboard

Multiple sheets inoperable due to data-calx-identifier attribute collision

Open devops-at-alinea opened this issue 7 years ago • 0 comments

The method for creating a data-calx-identifer hash leads to collisions which can make pages with multiple sheets inoperable:

init : function (option) {
    //code omitted
    sheetIdentifier = 'CALX'+(new Date()).valueOf();

Using date to create the hash value can lead to identical hash ids if sheets are initialised quickly:

$('.multiple_sheet_selector').calx({data:});

console.log( $('[data-calx-identifier="CALX1515156401661"]').length );
//outputs 2

This means there is only effectively one sheet in the page - which will be the last one init'd.

devops-at-alinea avatar Jan 05 '18 13:01 devops-at-alinea