Skip to content

Commit

Permalink
Dev: redesign ellipsis on questions and questiongroups
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jan 10, 2018
1 parent 1155107 commit 0657cf5
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 15 deletions.
8 changes: 8 additions & 0 deletions assets/packages/adminpanel/build/lsadminpanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@
height: 100%; }
#sidebar .dragPointer {
cursor: move; }
#sidebar .question-question-list .question-question-list-item .question-question-list-item-link {
display: inline-flex; }
#sidebar .question_text_ellipsize {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
padding-left: 2px; }

.bigIcons {
font-size: 18px;
Expand Down
25 changes: 19 additions & 6 deletions assets/packages/adminpanel/build/lsadminpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -36777,7 +36777,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
if (this.isMouseDown) {
this.isMouseDown = false;
this.$store.state.isCollapsed = false;
if (parseInt(this.sideBarWidth) < 335 && !this.$store.state.isCollapsed) {
if (parseInt(this.sideBarWidth) < 250 && !this.$store.state.isCollapsed) {
this.toggleCollapse();
this.$store.commit('changeSidebarwidth', '340px');
} else {
Expand Down Expand Up @@ -37052,6 +37052,9 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
},
createQuestionAllowed() {
return this.$store.state.questiongroups.length > 0;
},
itemWidth() {
return parseInt(this.$store.state.sidebarwidth) - 135 + 'px';
}
},
methods: {
Expand Down Expand Up @@ -37263,7 +37266,12 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
_vm.openQuestionGroup(questiongroup)
}
}
}, [_vm._v(" \n " + _vm._s(questiongroup.group_name) + " \n "), _c('span', {
}, [_c('span', {
staticClass: "question_text_ellipsize",
style: ({
width: _vm.itemWidth
})
}, [_vm._v(" " + _vm._s(questiongroup.group_name) + " ")]), _vm._v(" "), _c('span', {
staticClass: "badge pull-right ls-space margin right-5"
}, [_vm._v(_vm._s(questiongroup.questions.length))])]), _vm._v(" "), _c('i', {
staticClass: "fa bigIcons",
Expand All @@ -37279,7 +37287,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
"name": "slide-fade-down"
}
}, [(_vm.isActive(questiongroup.gid)) ? _c('ul', {
staticClass: "list-group background-muted padding-left",
staticClass: "list-group background-muted padding-left question-question-list",
on: {
"drop": function($event) {
_vm.dropQuestion($event, _vm.question)
Expand All @@ -37288,7 +37296,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
}, _vm._l((_vm.orderQuestions(questiongroup.questions)), function(question) {
return _c('li', {
key: question.qid,
staticClass: "list-group-item ls-flex-row align-itmes-flex-between",
staticClass: "list-group-item question-question-list-item ls-flex-row align-itmes-flex-between",
class: _vm.questionItemClasses(question),
on: {
"dragenter": function($event) {
Expand All @@ -37309,7 +37317,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
}
}
}, [_vm._v(" ")]), _vm._v(" "), _c('a', {
staticClass: "col-12 pjax",
staticClass: "col-12 pjax question-question-list-item-link",
attrs: {
"href": question.link,
"data-toggle": "tootltip",
Expand All @@ -37321,7 +37329,12 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
_vm.openQuestion(question)
}
}
}, [_c('i', [_vm._v("[" + _vm._s(question.title) + "]")]), _vm._v(" " + _vm._s((_vm.$store.state.maximalSidebar ? question.question : question.name_short)) + " ")])])
}, [_c('i', [_vm._v("[" + _vm._s(question.title) + "]")]), _vm._v(" "), _c('span', {
staticClass: "question_text_ellipsize",
style: ({
width: _vm.itemWidth
})
}, [_vm._v(" " + _vm._s(question.question) + " ")])])])
})) : _vm._e()])], 1)
}))])
},staticRenderFns: []}
Expand Down
2 changes: 1 addition & 1 deletion assets/packages/adminpanel/build/lsadminpanel.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/packages/adminpanel/build/lsadminpanel.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/packages/adminpanel/build/lsadminpanel.min.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions assets/packages/adminpanel/scss/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@
.dragPointer{
cursor: move;
}
.question-question-list{
.question-question-list-item{
.question-question-list-item-link{
display: inline-flex;

}
}

}
.question_text_ellipsize{
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
padding-left: 2px;
}
}

.bigIcons {
Expand Down
2 changes: 1 addition & 1 deletion assets/packages/adminpanel/src/components/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default {
if(this.isMouseDown){
this.isMouseDown = false;
this.$store.state.isCollapsed = false;
if(parseInt(this.sideBarWidth) < 335 && !this.$store.state.isCollapsed) {
if(parseInt(this.sideBarWidth) < 250 && !this.$store.state.isCollapsed) {
this.toggleCollapse();
this.$store.commit('changeSidebarwidth', '340px');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default {
},
createQuestionAllowed(){
return (this.$store.state.questiongroups.length > 0);
},
itemWidth(){
return (parseInt(this.$store.state.sidebarwidth)-135)+'px';
}
},
methods: {
Expand Down Expand Up @@ -181,16 +184,19 @@ export default {
<div class="col-12 ls-flex-row nowrap ls-space padding left-5 bottom-5">
<i class="fa fa-bars bigIcons dragPointer" draggable="true" @dragend="endDraggingGroup($event, questiongroup)" @dragstart="startDraggingGroup($event, questiongroup)">&nbsp;</i>
<a :href="questiongroup.link" @click.stop="openQuestionGroup(questiongroup)" class="col-12 pjax">
{{questiongroup.group_name}}
<span class="question_text_ellipsize" :style="{ width: itemWidth }"> {{questiongroup.group_name}} </span>
<span class="badge pull-right ls-space margin right-5">{{questiongroup.questions.length}}</span>
</a>
<i class="fa bigIcons" v-bind:class="isActive(questiongroup.gid) ? 'fa-caret-up' : 'fa-caret-down'" @click.prevent="toggleActivation(questiongroup.gid)">&nbsp;</i>
</div>
<transition name="slide-fade-down">
<ul class="list-group background-muted padding-left" v-if="isActive(questiongroup.gid)" @drop="dropQuestion($event, question)">
<li v-for="question in orderQuestions(questiongroup.questions)" v-bind:key="question.qid" v-bind:class="questionItemClasses(question)" class="list-group-item ls-flex-row align-itmes-flex-between" @dragenter="dragoverQuestion($event, question, questiongroup)">
<ul class="list-group background-muted padding-left question-question-list" v-if="isActive(questiongroup.gid)" @drop="dropQuestion($event, question)">
<li v-for="question in orderQuestions(questiongroup.questions)" v-bind:key="question.qid" v-bind:class="questionItemClasses(question)" class="list-group-item question-question-list-item ls-flex-row align-itmes-flex-between" @dragenter="dragoverQuestion($event, question, questiongroup)">
<i class="fa fa-bars margin-right bigIcons dragPointer" draggable="true" @dragend="endDraggingQuestion($event, question)" @dragstart="startDraggingQuestion($event, question, questiongroup)">&nbsp;</i>
<a :href="question.link" class="col-12 pjax" @click.prevent="openQuestion(question)" data-toggle="tootltip" :title="question.question"> <i>[{{question.title}}]</i> {{($store.state.maximalSidebar ? question.question : question.name_short)}} </a>
<a :href="question.link" class="col-12 pjax question-question-list-item-link" @click.prevent="openQuestion(question)" data-toggle="tootltip" :title="question.question">
<i>[{{question.title}}]</i>
<span class="question_text_ellipsize" :style="{ width: itemWidth }"> {{ question.question }} </span>
</a>
</li>
</ul>
</transition>
Expand Down

0 comments on commit 0657cf5

Please sign in to comment.