From be5ec6394bdc97c25ca2a2c21f2612159dd1db44 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 29 May 2015 12:09:23 -0400 Subject: [PATCH] #2308, Fix issue with metadata caching prop values --- RELEASE-NOTES.md | 1 + src/definitions/modules/popup.js | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index deac9571c..5da92a2e9 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -97,6 +97,7 @@ - **Menu** - Vertical dropdown menus are no longer 100% `min-width` - **Modal** - Modal `onApprove` and `onDeny` now receive the activating element as the first parameter. Added documentation about using `return false` to avoid hiding element on click. - **Modal** - Modal content now uses flex, image content now requires `image content` class on parent to allow for flex stylings. +- **Popup** - `onShow` and `onHide` callback can now cancel popup from showing or hiding by returning false - **Popup** - Added more size variations for popup `mini`, `tiny` - **Progress** - `indicating` labels now are more legible use separate css variables from `indicating` bar color - **Reveal** - Added new `active` state that allows you to show `reveal` programatically diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index 3eda812e8..1cdef1d52 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -125,6 +125,14 @@ $.fn.popup = function(parameters) { } }, + refreshData: function() { + module.verbose('Refreshing metadata attributes'); + $module.removeData(metadata.html); + $module.removeData(metadata.title); + $module.removeData(metadata.content); + $module.removeData(metadata.variation); + }, + reposition: function() { module.refresh(); module.set.position(); @@ -176,11 +184,19 @@ $.fn.popup = function(parameters) { // generates popup html from metadata create: function() { var - html = $module.data(metadata.html) || settings.html, - variation = $module.data(metadata.variation) || settings.variation, - title = $module.data(metadata.title) || settings.title, - content = $module.data(metadata.content) || $module.attr('title') || settings.content + html, + variation, + title, + content ; + + module.refreshData(); + + html = $module.data(metadata.html) || settings.html; + variation = $module.data(metadata.variation) || settings.variation; + title = $module.data(metadata.title) || settings.title; + content = $module.data(metadata.content) || $module.attr('title') || settings.content; + if(html || content || title) { module.debug('Creating pop-up html'); if(!html) {