Permalink
Browse files

Dismissable content: Use ID attribute if present as content ID.

  • Loading branch information...
thomasgohard committed May 22, 2015
1 parent d7a4fc7 commit fbe30ffdf0572416278b48cd2451fa3c76f7f4e9
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/plugins/dismissable-content/dismissable-content.js
@@ -45,7 +45,17 @@ var componentName = "wb-dismissable",
}
// Give the dismissable element a unique ID
itemId = wb.hashString( wb.stripWhitespace( elm.innerHTML ) );
if ( elm.hasAttribute( "id" ) ) {
itemId = elm.getAttribute( "id" );
// Ignore an ID assigned by wb
if ( itemId.indexOf( "wb-auto-" ) === 0 ) {
itemId = undefined;
}
}
if ( itemId === undefined ) {
itemId = wb.hashString( wb.stripWhitespace( elm.innerHTML ) );
}
dismissedState = getDismissedState( itemId );

0 comments on commit fbe30ff

Please sign in to comment.