Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'danbev-RHMAP-4762-hide-page-number'
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed May 10, 2016
2 parents 76c651c + 12cc1d1 commit 96e20e1
Show file tree
Hide file tree
Showing 16 changed files with 897 additions and 496 deletions.
37 changes: 21 additions & 16 deletions dist/appForms-backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -4391,18 +4391,19 @@ StepsView = Backbone.View.extend({
width = 100 / displayedPages.length;
}

displayedPages.forEach(function(pageId, index) {
var pageModel = self.parentView.getPageViewById(pageId).model;
var item = $(_.template(self.templates.step)( {
step_name: pageModel.getName(),
step_num: index + 1,
index: self.parentView.getPageIndexById(pageId),
width: width
}));
$(table).append(item);
});

this.$el.append(table);
if (displayedPages.length > 1 ) {
displayedPages.forEach(function(pageId, index) {
var pageModel = self.parentView.getPageViewById(pageId).model;
var item = $(_.template(self.templates.step)( {
step_name: pageModel.getName(),
step_num: index + 1,
index: self.parentView.getPageIndexById(pageId),
width: width
}));
$(table).append(item);
});
this.$el.append(table);
}
this.$el.append(self.templates.page_title);
this.$el.append(self.templates.page_description);
return this;
Expand Down Expand Up @@ -4430,12 +4431,15 @@ StepsView = Backbone.View.extend({

self.$el.find('li:eq(' + displayIndex + ')').addClass('active');

if(pageName.length === 0){
pageName = "Page " + (displayIndex + 1);
var hasCustomPageName = pageName.length !== 0;
var displayedPages = this.parentView.getDisplayedPages();
if (displayedPages.length > 1 || hasCustomPageName) {
if (!hasCustomPageName){
pageName = "Page " + (displayIndex + 1);
}
self.$el.find('.fh_appform_page_title').html(pageName);
}

self.$el.find('.fh_appform_page_title').html(pageName);

if(pageDescription.length > 0){
self.$el.find('.fh_appform_page_description').html(pageDescription);
} else {
Expand All @@ -4445,6 +4449,7 @@ StepsView = Backbone.View.extend({
}

});

var ConfigView = Backbone.View.extend({
templates: {

Expand Down
Loading

0 comments on commit 96e20e1

Please sign in to comment.