summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-03-26 17:08:29 +0000
committerhallgren <hallgren@chalmers.se>2012-03-26 17:08:29 +0000
commit671c9b539040f2f3e75bac96630805236a97d298 (patch)
tree29a1868d0e5bd55460af8f8e1abe802f428849cf /src
parent14e712595883fa068cd498bf9749d49e55b8c333 (diff)
gfse&minibar: fix bug caused by function name clash
+ Function div_id was defined in both editor.js and support.js. Solution: moved the more general version from editor.js to support.js. + Function div_class was defined in both editor.js and support.js. Solution: resolv incompatibility with an argument type test and put the generalized function in support.js.
Diffstat (limited to 'src')
-rw-r--r--src/www/gfse/editor.js2
-rw-r--r--src/www/minibar/support.js6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/www/gfse/editor.js b/src/www/gfse/editor.js
index 05cd886ef..6e51d2fc1 100644
--- a/src/www/gfse/editor.js
+++ b/src/www/gfse/editor.js
@@ -1387,8 +1387,6 @@ function touch_edit() {
}
/* --- DOM Support ---------------------------------------------------------- */
-function div_id(id,cs) { return node("div",{id:id},cs); }
-function div_class(cls,cs) { return node("div",{"class":cls},cs); }
function a(url,linked) { return node("a",{href:url},linked); }
function ul(lis) { return node("ul",{},lis); }
function li(xs) { return node("li",{},xs); }
diff --git a/src/www/minibar/support.js b/src/www/minibar/support.js
index 0e332a5c7..5d0158ad1 100644
--- a/src/www/minibar/support.js
+++ b/src/www/minibar/support.js
@@ -143,13 +143,15 @@ function empty(tag,name,value) {
function empty_id(tag,id) { return empty(tag,"id",id); }
function empty_class(tag,cls) { return empty(tag,"class",cls); }
-function div_id(id) { return empty_id("div",id); }
+function div_id(id,cs) { return node("div",{id:id},cs); }
function span_id(id) { return empty_id("span",id); }
function wrap(tag,contents) { return node(tag,{},[contents]); }
function wrap_class(tag,cls,contents) {
- return node(tag,{"class":cls},contents ? [contents] : [])
+ return node(tag,{"class":cls},
+ contents ? Array.isArray(contents) ?
+ contents : [contents] : [])
}
function span_class(cls,contents) { return wrap_class("span",cls,contents); }