(function($){
+ var PLUGIN_NAME = 'GoogleMap';
+
// routing calls
jQuery.fn.GoogleMap = function( method ) {
if ( methods[method] ) {
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
- jQuery.error( 'Method ' + method + ' does not exist on jQuery.GoogleMap' );
+ jQuery.error( 'Method ' + method + ' does not exist on jQuery.' + PLUGIN_NAME );
}
};
plugin.initialize();
/* Events */
- $this.on('show.GoogleMaps', methods.show);
+ $this.on('show.' + PLUGIN_NAME, methods.show);
$this.set_query_handler(options.query_uuid, plugin.query_handler);
$this.set_record_handler(options.query_uuid, plugin.record_handler);
var hazelnut = $this.data('Manifold');
// Unbind all events using namespacing
- $(window).unbind('Manifold');
+ $(window).unbind(PLUGIN_NAME);
// Remove associated data
hazelnut.remove();
case FILTER_ADDED:
case FILTER_REMOVED:
case CLEAR_FILTERS:
- // XXX Here we might need to maintain the list of filters !
- /* Process updates in filters / current_query must be updated before this call for filtering ! */
- object.table.fnDraw();
break;
// Fields
/* Hide/unhide columns to match added/removed fields */
case FIELD_ADDED:
- var object = this;
- $.each(added_fields, function (index, field) {
- var index = object.getColIndex(field,cols);
- if(index != -1)
- object.table.fnSetColumnVis(index, true);
- });
break;
case FIELD_REMOVED:
- var object = this;
- $.each(removed_fields, function (index, field) {
- var index = object.getColIndex(field,cols);
- if(index != -1)
- object.table.fnSetColumnVis(index, false);
- });
break;
case CLEAR_FIELDS:
alert('GoogleMaps::clear_fields() not implemented');