Views can be appended or prepended
Change-Id: Ie3f316b1b8a223d0ccc0ae3fe63a7aff2b2d0ca2
diff --git a/dev/js/src/panel.js b/dev/js/src/panel.js
index acdf6d8..4ebef1e 100644
--- a/dev/js/src/panel.js
+++ b/dev/js/src/panel.js
@@ -29,6 +29,9 @@
c.push.apply(c,classes);
this.actions = buttonGroupClass.create(c).bind(this);
+ //prepend or append views of the panel
+ this.prepend = false;
+
// Warning: This is circular
this.actions.panel = this;
return this;
@@ -79,12 +82,18 @@
// Add view to views list
this.views.push(view);
- // Append element to panel element
-
+ // Append or prepend element to panel element
+ if(this.prepend){
+ this._viewElement().prepend(
+ view.element()
+ );
+ }
+ else{
this._viewElement().appendChild(
view.element()
);
-
+ }
+
if (view.afterEmbed)
view.afterEmbed();
diff --git a/dev/js/src/panel/result.js b/dev/js/src/panel/result.js
index 02c6e53..15eb479 100644
--- a/dev/js/src/panel/result.js
+++ b/dev/js/src/panel/result.js
@@ -37,6 +37,7 @@
KorAP.Plugin.clearButtonGroup("result");
};
+ this.prepend = true;
return this;
},