Commit 16136ca1 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Merge branch 'improvement/accept-a-dom-node-for-initializing-the-map' into 'master'

Accept a DOM element, rather than an element ID string, for initializing the...

See merge request !4
parents b93b878f ec063499
......@@ -35,7 +35,7 @@ var Spinner = require("./Spinner");
*/
/**
* Main view
* @param divId The placeholder ID in DOM
* @param divId The placeholder ID in DOM (or alternatively, a DOM node)
* @param mode The view mode (basic or advanced)
* @param config The configuration file as an Object
* @param rulesets An array of rulesets defining map styles
......@@ -52,7 +52,7 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService
this.mode = (mode == "advanced") ? mode : "basic";
/** The main view DOM **/
this.dom = $("#"+divId);
this.dom = (typeof divId == 'string') ? $("#"+divId) : $(divId);
/** The leaflet map **/
this.map = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment