Skip to content

Commit

Permalink
Fixed issue #12509: Too much white space in admin UI and some other t…
Browse files Browse the repository at this point in the history
…hings
  • Loading branch information
lacrioque committed Nov 23, 2017
1 parent ac977eb commit 2a60fee
Show file tree
Hide file tree
Showing 10 changed files with 469 additions and 392 deletions.
3 changes: 2 additions & 1 deletion application/controllers/admin/surveyadmin.php
Expand Up @@ -443,7 +443,8 @@ public function view($iSurveyID, $gid = null, $qid = null)
$aData['showLastQuestion'] = false;
}
$aData['templateapiversion'] = Template::model()->getTemplateConfiguration(null, $iSurveyID)->getApiVersion();



$this->_renderWrappedTemplate('survey', array(), $aData);
}

Expand Down
2 changes: 1 addition & 1 deletion application/core/Survey_Common_Action.php
Expand Up @@ -1229,7 +1229,7 @@ public function _surveysummary($aData)
// We get the state of the quickaction
// If the survey is new (ie: it has no group), it is opened by default
$aData['quickactionstate'] = (int) SettingsUser::getUserSettingValue('quickaction_state');

$aData['subviewData'] = $aData;
$content = $this->getController()->renderPartial("/admin/survey/surveySummary_view", $aData, true);
$this->getController()->renderPartial("/admin/super/sidebody", array(
'content' => $content,
Expand Down
333 changes: 333 additions & 0 deletions application/views/admin/survey/subview/_survey_quickaction.php

Large diffs are not rendered by default.

503 changes: 115 additions & 388 deletions application/views/admin/survey/surveySummary_view.php

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions assets/packages/adminpanel/build/lsadminpanel.js
Expand Up @@ -36401,6 +36401,7 @@ $(document).on('ready', function () {
$(document).on('pjax:success', () => {
$('#pjaxClickInhibitor').fadeOut(400, function(){$(this).remove();});
$('#pjax-file-load-container').find('div').css('width', '100%');
$(document).trigger('vue-sidemenu-update-link');
setTimeout(function () {
$('#pjax-file-load-container').find('div').css({
'width': '0%',
Expand Down Expand Up @@ -36837,6 +36838,10 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
this.getTopmenus();
this.getBottommenus();

$(document).on('vue-sidemenu-update-link', () => {
this.controlActiveLink();
});

$(document).on('vue-redraw', () => {
this.getQuestions();
this.getSidemenus();
Expand Down Expand Up @@ -39384,6 +39389,7 @@ const getAppState = function (userid) {
},
changeIsCollapsed(state, value) {
state.isCollapsed = value;
$(document).trigger('vue-sidemenu-update-link');
},
changeMaxHeight(state, newHeight) {
state.maxHeight = newHeight;
Expand Down
2 changes: 1 addition & 1 deletion assets/packages/adminpanel/build/lsadminpanel.js.map

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.

8 changes: 8 additions & 0 deletions assets/packages/adminpanel/src/components/sidebar.vue
Expand Up @@ -78,26 +78,30 @@ export default {
controlActiveLink(){
//get current location
let currentUrl = window.location.href;
//Check for corresponding menuItem
let lastMenuItemObject = false;
_.each(this.$store.state.sidemenus, (itm,i)=>{
_.each(itm.entries, (itmm,j)=>{
lastMenuItemObject = _.endsWith(currentUrl,itmm.link) ? itmm : lastMenuItemObject;
});
});
//check for quickmenu menuLinks
let lastQuickMenuItemObject = false;
_.each(this.$store.state.collapsedmenus, (itm,i)=>{
_.each(itm.entries, (itmm,j)=>{
lastQuickMenuItemObject = _.endsWith(currentUrl,itmm.link) ? itmm : lastQuickMenuItemObject;
});
});
//check for corresponding question group object
let lastQuestionGroupObject = false;
_.each(this.$store.state.questiongroups, (itm,i)=>{
let regTest = new RegExp('questiongroups/sa/edit/surveyid/'+itm.sid+'/gid/'+itm.gid);
lastQuestionGroupObject = (regTest.test(currentUrl) || _.endsWith(currentUrl,itm.link)) ? itm : lastQuestionGroupObject;
});
//check for corresponding question group
let lastQuestionObject = false;
_.each(this.$store.state.questiongroups, (itm,i)=>{
Expand Down Expand Up @@ -276,6 +280,10 @@ export default {
this.getTopmenus();
this.getBottommenus();
$(document).on('vue-sidemenu-update-link', ()=>{
this.controlActiveLink();
});
$(document).on('vue-redraw', ()=>{
this.getQuestions();
this.getSidemenus();
Expand Down
1 change: 1 addition & 0 deletions assets/packages/adminpanel/src/main.js
Expand Up @@ -90,6 +90,7 @@ $(document).on('ready', function () {
$(document).on('pjax:success', () => {
$('#pjaxClickInhibitor').fadeOut(400, function(){$(this).remove();});
$('#pjax-file-load-container').find('div').css('width', '100%');
$(document).trigger('vue-sidemenu-update-link');
setTimeout(function () {
$('#pjax-file-load-container').find('div').css({
'width': '0%',
Expand Down
1 change: 1 addition & 0 deletions assets/packages/adminpanel/src/store/vuex-store.js
Expand Up @@ -66,6 +66,7 @@ const getAppState = function (userid) {
},
changeIsCollapsed(state, value) {
state.isCollapsed = value;
$(document).trigger('vue-sidemenu-update-link');
},
changeMaxHeight(state, newHeight) {
state.maxHeight = newHeight;
Expand Down

0 comments on commit 2a60fee

Please sign in to comment.