mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-07 18:22:50 -06:00
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.
This commit is contained in:
@@ -1387,8 +1387,6 @@ function touch_edit() {
|
|||||||
}
|
}
|
||||||
/* --- DOM Support ---------------------------------------------------------- */
|
/* --- 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 a(url,linked) { return node("a",{href:url},linked); }
|
||||||
function ul(lis) { return node("ul",{},lis); }
|
function ul(lis) { return node("ul",{},lis); }
|
||||||
function li(xs) { return node("li",{},xs); }
|
function li(xs) { return node("li",{},xs); }
|
||||||
|
|||||||
@@ -143,13 +143,15 @@ function empty(tag,name,value) {
|
|||||||
function empty_id(tag,id) { return empty(tag,"id",id); }
|
function empty_id(tag,id) { return empty(tag,"id",id); }
|
||||||
function empty_class(tag,cls) { return empty(tag,"class",cls); }
|
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 span_id(id) { return empty_id("span",id); }
|
||||||
|
|
||||||
function wrap(tag,contents) { return node(tag,{},[contents]); }
|
function wrap(tag,contents) { return node(tag,{},[contents]); }
|
||||||
|
|
||||||
function wrap_class(tag,cls,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); }
|
function span_class(cls,contents) { return wrap_class("span",cls,contents); }
|
||||||
|
|||||||
Reference in New Issue
Block a user