Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenaka Moorthi <benaka.moorthi@gmail.com>2013-08-27 13:41:44 +0400
committerBenaka Moorthi <benaka.moorthi@gmail.com>2013-08-27 13:41:44 +0400
commit29b4cf8b7c712dc9bacd105043cb1fc5dff0db09 (patch)
tree714ddeeea4b49317817c63085a8f5ea88c6f2001 /plugins/CoreHome
parenteb00e8722bda06313d2c47719fe33865bd4a76e9 (diff)
Refs #3089, make sure visitor profile can be opened via popover, document popover persisting functions in broadcast object and hide 'There is no data' message in embedded real time map in the visitor profile popup.
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r--plugins/CoreHome/javascripts/broadcast.js24
-rw-r--r--plugins/CoreHome/javascripts/popover.js7
2 files changed, 28 insertions, 3 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js
index 761404efbd..e09c2dbc9c 100644
--- a/plugins/CoreHome/javascripts/broadcast.js
+++ b/plugins/CoreHome/javascripts/broadcast.js
@@ -314,7 +314,20 @@ var broadcast = {
},
/**
- * Update the part after the second hash
+ * Loads a popover by adding a 'popover' query parameter to the current URL and
+ * indirectly executing the popover handler.
+ *
+ * This function should be called to open popovers that can be opened by URL alone.
+ * That is, if you want users to be able to copy-paste the URL displayed when a popover
+ * is open into a new browser window/tab and have the same popover open, you should
+ * call this function.
+ *
+ * In order for this function to open a popover, there must be a popover handler
+ * associated with handlerName. To associate one, call broadcast.addPopoverHandler.
+ *
+ * @param {String} handlerName The name of the popover handler.
+ * @param {String} value The String value that should be passed to the popover
+ * handler.
*/
propagateNewPopoverParameter: function (handlerName, value) {
// init broadcast if not already done (it is required to make popovers work in widgetize mode)
@@ -352,7 +365,14 @@ var broadcast = {
},
/**
- * Add a handler for the popover parameter
+ * Adds a handler for the 'popover' query parameter.
+ *
+ * @see broadcast#propagateNewPopoverParameter
+ *
+ * @param {String} handlerName The handler name, eg, 'visitorProfile'. Should identify
+ * the popover that the callback will open up.
+ * @param {Function} callback This function should open the popover. It should take
+ * one string parameter.
*/
addPopoverHandler: function (handlerName, callback) {
broadcast.popoverHandlers[handlerName] = callback;
diff --git a/plugins/CoreHome/javascripts/popover.js b/plugins/CoreHome/javascripts/popover.js
index 8cb4afe60b..e3ff6d9326 100644
--- a/plugins/CoreHome/javascripts/popover.js
+++ b/plugins/CoreHome/javascripts/popover.js
@@ -207,7 +207,12 @@ var Piwik_Popover = (function () {
},
/**
- * Create a Popover and load the specified URL in it
+ * Create a Popover and load the specified URL in it.
+ *
+ * Note: If you want the popover to be persisted in the URL (so if the URL is copy/pasted
+ * to a new window/tab it will be opened there), use broadcast.propagateNewPopoverParameter
+ * with a popover handler function that calls this one.
+ *
* @param {string} url
* @param {string} loadingName
* @param {string} [dialogClass] css class to add to dialog