Skip to content
Extraits de code Groupes Projets
Valider 60b80b53 rédigé par Gregor Aisch's avatar Gregor Aisch
Parcourir les fichiers

refactored visitor map widget the ninja way

parent 5c0fdc9d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -46,8 +46,6 @@
this.uniqueId = this.options.uniqueId;
}
piwikHelper.log('widget._create() '+this.uniqueId);
if(this.options.widgetParameters) {
this.widgetParameters = this.options.widgetParameters;
}
......@@ -69,6 +67,7 @@
$('[widgetId='+this.uniqueId+']').dialog('destroy');
}
$('*', this.element).off('.dashboardWidget'); // unbind all events
$('.widgetContent', this.element).trigger('widget:destroy');
return this;
},
......@@ -134,10 +133,9 @@
*/
reload: function(hideLoading, notJQueryUI) {
if (!notJQueryUI) {
piwikHelper.log('widget.reload() was called by jquery.ui', arguments.callee.caller);
piwikHelper.log('widget.reload() was called by jquery.ui, ignoring', arguments.callee.caller);
return;
}
piwikHelper.log('widget.reload() '+this.uniqueId);
var self = this, currentWidget = this.element;
function onWidgetLoadedReplaceElementWithContent(loadedContent)
......@@ -265,9 +263,6 @@
widgetElement.show();
}
/*_destroy: function() {
piwikHelper.log('destroyed widget', this.uniqueId);
}*/
});
})( jQuery );
Ce diff est replié.
......@@ -67,29 +67,29 @@
<!-- configure some piwik vars -->
<script type="text/javascript">
var config = JSON.parse('{$config}');
UserCountryMap._ = JSON.parse('{$localeJSON}');
UserCountryMap.reqParams = JSON.parse('{$reqParamsJSON}');
var visitorMap,
config = JSON.parse('{$config}');
config._ = JSON.parse('{$localeJSON}');
config.reqParams = JSON.parse('{$reqParamsJSON}');
$('.UserCountryMap').addClass('dataTable');
var widget = $('.UserCountryMap').parents('.widgetContent');
piwikHelper.log('loaded map widget to DOM');
{literal}
widget.on('widget:loaded', function(evt, widget) {
UserCountryMap.theWidget = widget;
piwikHelper.log('catched widget:load event, running map', config);
UserCountryMap.run(config);
widget.on('widget:loaded', function(evt, _widget) {
//piwikHelper.log('catched widget:load event, running map', config, _widget);
visitorMap = new UserCountryMap.VisitorMap(config, _widget);
});
widget.on('widget:maximise', function(evt) {
UserCountryMap.resize();
visitorMap.resize();
});
widget.on('widget:minimise', function(evt) {
UserCountryMap.resize();
visitorMap.resize();
});
widget.on('widget:destroy', function(evt) {
visitorMap.destroy();
});
{/literal}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter