Last active
September 9, 2019 11:03
-
-
Save MattisOlsson/b25298f7c501183fb51e535da4f6a7ee to your computer and use it in GitHub Desktop.
ContentSelectorWithIcons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'dojo/_base/declare', | |
'dojo/_base/lang', | |
'epi-cms/widget/ContentSelectorDialog', | |
'epi-cms/widget/ContentTree', | |
"epi-cms/component/_ContentNavigationTreeNode" | |
], function( | |
declare, | |
lang, | |
ContentSelectorDialog, | |
ContentTree, | |
_ContentNavigationTreeNode | |
) { | |
return declare('app/widgets/ContentSelectorDialogWithIcons', [ContentSelectorDialog], { | |
nodeConstructor: _ContentNavigationTreeNode, | |
addChild: function(child) { | |
if (child instanceof ContentTree) { | |
child.nodeConstructor = this.nodeConstructor; | |
child._createTreeNode = function (args) { | |
var params = lang.mixin({}, args, { | |
dndData: args.item, | |
hasContextMenu: false | |
}); | |
return this.buildNodeFromTemplate(params); | |
}; | |
} | |
this.inherited(arguments); | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'dojo/_base/declare', | |
'epi-cms/widget/ContentSelector', | |
'app/widgets/ContentSelectorDialogWithIcons' | |
], function( | |
declare, | |
ContentSelector, | |
ContentSelectorDialogWithIcons | |
) { | |
return declare('app/widgets/ContentSelectorWithIcons', [ContentSelector], { | |
createDialogContent: function () { | |
return new ContentSelectorDialogWithIcons({ | |
canSelectOwnerContent: this.canSelectOwnerContent, | |
showButtons: false, | |
roots: this.roots, | |
allowedTypes: this.allowedTypes, | |
restrictedTypes: this.restrictedTypes, | |
showAllLanguages: this.showAllLanguages, | |
showSearchBox: this.showSearchBox, | |
searchArea: this.searchArea | |
}); | |
}, | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[EditorDescriptorRegistration(TargetType = typeof(ContentReference), EditorDescriptorBehavior = EditorDescriptorBehavior.OverrideDefault)] | |
public class EnhancedContentReferenceEditorDescriptor : ContentReferenceEditorDescriptor | |
{ | |
public EnhancedContentReferenceEditorDescriptor() | |
{ | |
ClientEditingClass = "app/widgets/ContentSelectorWithIcons"; | |
} | |
protected override void SetEditorConfiguration(ExtendedMetadata metadata) | |
{ | |
base.SetEditorConfiguration(metadata); | |
metadata.EditorConfiguration["searchArea"] = "cms/pages"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment