Toggle through alignment options (Fix #56)
Change-Id: Ife23578c74ea75d4748b4e779d0aa870e6b34776
diff --git a/dev/js/src/panel/result.js b/dev/js/src/panel/result.js
index bee0409..a572180 100644
--- a/dev/js/src/panel/result.js
+++ b/dev/js/src/panel/result.js
@@ -65,9 +65,22 @@
* Toggle the alignment (left <=> right)
*/
this.actions.add(loc.TOGGLE_ALIGN, ['align','right','button-icon'], function (e) {
- var ol = d.querySelector('#search > ol');
- ol.toggleClass("align-left", "align-right");
- this.button.toggleClass("left", "right");
+ var olCl = d.querySelector('#search > ol').classList;
+ if (olCl.contains('align-left')) {
+ olCl.remove('align-left');
+ olCl.add('align-right');
+ this.button.toggleClass("right", "center");
+ }
+ else if (olCl.contains('align-right')) {
+ olCl.remove('align-right');
+ olCl.add('align-center');
+ this.button.toggleClass("center", "left");
+ }
+ else if (olCl.contains('align-center')) {
+ olCl.remove('align-center');
+ olCl.add('align-left');
+ this.button.toggleClass("left", "right");
+ };
});
}
}
diff --git a/dev/scss/main/resultinfo.scss b/dev/scss/main/resultinfo.scss
index d1c7f86..0308df6 100644
--- a/dev/scss/main/resultinfo.scss
+++ b/dev/scss/main/resultinfo.scss
@@ -48,6 +48,9 @@
&.align.right::after {
content: $fa-right-align;
}
+ &.align.center::after {
+ content: $fa-center-align;
+ }
&.show-kq::after {
content: $fa-code;
}
diff --git a/dev/scss/util.scss b/dev/scss/util.scss
index aa13a3c..52456b6 100644
--- a/dev/scss/util.scss
+++ b/dev/scss/util.scss
@@ -234,30 +234,31 @@
/**
* Font Awesome symbol table
*/
-$fa-bars: "\f0c9";
-$fa-extlink: "\f08e";
-$fa-up: "\f0d8";
-$fa-down: "\f0d7";
-$fa-close: "\f00d";
-$fa-download: "\f019";
-$fa-info: "\f05a";
-$fa-elipsis: "\f141";
-$fa-previous: "\f0d9";
-$fa-next: "\f0da";
-$fa-search: "\f002";
-$fa-rewrite: "\f040";
-$fa-login: "\f090";
-$fa-logout: "\f08b";
-$fa-tutorial: "\f19d";
-$fa-left-align: "\f036";
-$fa-right-align: "\f038";
-$fa-question: "\f128";
-$fa-checked: "\f046";
-$fa-check: "\f096";
-$fa-code: "\f121";
-$fa-marked: "\f005";
+$fa-bars: "\f0c9";
+$fa-extlink: "\f08e";
+$fa-up: "\f0d8";
+$fa-down: "\f0d7";
+$fa-close: "\f00d";
+$fa-download: "\f019";
+$fa-info: "\f05a";
+$fa-elipsis: "\f141";
+$fa-previous: "\f0d9";
+$fa-next: "\f0da";
+$fa-search: "\f002";
+$fa-rewrite: "\f040";
+$fa-login: "\f090";
+$fa-logout: "\f08b";
+$fa-tutorial: "\f19d";
+$fa-left-align: "\f036";
+$fa-right-align: "\f038";
+$fa-center-align: "\f037";
+$fa-question: "\f128";
+$fa-checked: "\f046";
+$fa-check: "\f096";
+$fa-code: "\f121";
+$fa-marked: "\f005";
// $fa-metadata: "\f067";
-$fa-metadata: "\f055";
-$fa-to-query: "\f102";
-$fa-cut: "\f0c4";
-$fa-plugin: "\f1e6";
\ No newline at end of file
+$fa-metadata: "\f055";
+$fa-to-query: "\f102";
+$fa-cut: "\f0c4";
+$fa-plugin: "\f1e6";
\ No newline at end of file