Skip to content

Commit

Permalink
Revert "Creating page from template with correct parent page. (resolv…
Browse files Browse the repository at this point in the history
…es issue #23)"

This reverts commit 368bb75.
  • Loading branch information
milosmih92 committed Aug 18, 2019
1 parent 368bb75 commit 0839337
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@

var instantTemplatesStore = registry.get("instanttemplates");

dojo.when(instantTemplatesStore.get(that.contentLink), function (response) {
dojo.when(instantTemplatesStore.get(that.parentLink), function (response) {
array.forEach(response, function (contentData) {
var child = new ContentType({ contentData: contentData });
that.connect(child, "onSelect", that.onSelect);
that.addChild(child);
this.connect(child, "onSelect", this.onSelect);
this.addChild(child);
}, that);
});
},
Expand Down Expand Up @@ -113,7 +113,7 @@
// callback

topic.publish("/epi/shell/action/changeview", "instantTemplates/CreateContentView", null, {
parent: item.parentLink,
parent: this.parentLink,
contentLink: item.contentLink,
headingText: "New Instant Template",
templateName: item.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,42 +57,15 @@ function (

templatesRoot: null,

updateView: function (data, context, additionalParams) {
var self = this;
topic.subscribe("/epi/shell/action/changeview", function (name, args) {
if (name !== "instantTemplates/ContentTypeList") return;
self.parentLink = args.parentLink;
self.contentLink = args.contentLink;
self.render();
});
},

clear: function () {
// summary:
// Destroys the current view.
// tags:
// public

array.forEach(this.getChildren(), function (child) {
this.removeChild(child);
child.destroyRecursive();
}, this);
},

postCreate: function () {
this.render();
},

render: function () {
buildRendering: function () {
// summary:
// Construct the base UI with suggested content types.
// tags:
// protected

this.inherited(arguments);
this.clear();

var suggested = new ContentTypeGroup({ templatesRoot: this.templatesRoot, contentLink: this.contentLink });
var suggested = new ContentTypeGroup({templatesRoot: this.templatesRoot, parentLink: this.parentLink});

domClass.add(suggested.titleNode, "epi-ribbonHeaderSpecial");
suggested.set("title", "Available Instant Templates");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
var selectionData = this.get("selectionData");

topic.publish("/epi/shell/action/changeview", "instantTemplates/ContentTypeList", {
parentLink: selectionData.parentLink,
contentLink: selectionData.contentLink,
parentLink: selectionData.contentLink,
contentLink: this.contentLink,
templatesRoot: this.templatesRoot
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public RestResult Get(string id)
{
name = content.Name,
contentLink = content.ContentLink.ID.ToString(CultureInfo.InvariantCulture),
parentLink = parentContent.ContentLink.ID.ToString(CultureInfo.InvariantCulture),
ContentType = this._contentTypeRepository.Load(content.ContentTypeID),
localizedDescription = this._contentTypeRepository.Load(content.ContentTypeID).LocalizedDescription
});
Expand Down

0 comments on commit 0839337

Please sign in to comment.