Skip to content

Commit

Permalink
Update panel.js (#8)
Browse files Browse the repository at this point in the history
* Update panel.js

add custom javascript event on the new panel

* Update panel.js
  • Loading branch information
linkrb authored and dodubassman committed Mar 15, 2019
1 parent 6829e75 commit 2cba077
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Resources/public/js/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ $(document).ready(function () {
// Display html content
$collectionHolder.append($embededItem);

// add custom javascript event on the new panel
var eventItem = new CustomEvent('ublock.after_added', { 'detail' : $embededItem });
document.dispatchEvent(eventItem);

// Scroll to newly created block
$('html, body').animate({
scrollTop: $embededItem.offset().top - 130
Expand Down

0 comments on commit 2cba077

Please sign in to comment.