Compare commits

...

7 Commits

Author SHA1 Message Date
kgiszewski abf6917b1c bump to v1.13.1 2016-06-26 12:10:11 -04:00
kgiszewski 40ad701f7f Merge branch 'master' into pr/365 2016-06-26 12:05:18 -04:00
Kevin Giszewski a8113f926c Merge pull request #369 from kipusoep/master
Fixed #368
2016-06-16 16:21:21 -04:00
Kevin Giszewski 3c527396de Merge pull request #364 from Nicholas-Westby/fix/362-drag-fieldset-undefined
Fix for error during Archetype drags when there are rich text editors…
2016-06-16 16:12:33 -04:00
Stefan Kip 59bf66dcd1 Fixed #368 2016-06-16 20:11:02 +02:00
Nicholas-Westby c125042a86 Avoid fieldsets that can't be expanded: https://github.com/imulus/Archetype/issues/363 2016-05-20 21:38:39 -07:00
Nicholas-Westby 85ea472129 Fix for error during Archetype drags when there are rich text editors outside of Archetype: https://github.com/imulus/Archetype/issues/362 2016-05-18 20:03:05 -07:00
5 changed files with 40 additions and 16 deletions
@@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("1.13.0")]
[assembly: AssemblyFileVersion("1.13.0")]
[assembly: AssemblyVersion("1.13.1")]
[assembly: AssemblyFileVersion("1.13.1")]
+22 -2
View File
@@ -323,6 +323,11 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc
$scope.$broadcast("archetypeAddFieldset", {index: $index, visible: countVisible()});
newFieldset.collapse = $scope.model.config.enableCollapsing ? true : false;
// If the fieldset is not collapsed, it should be instantly loaded.
if (!newFieldset.collapse) {
$scope.loadedFieldsets.push(newFieldset);
}
$scope.focusFieldset(newFieldset);
}
@@ -356,6 +361,12 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc
$scope.setDirty();
newFieldset.collapse = $scope.model.config.enableCollapsing ? true : false;
// If the fieldset is not collapsed, it should be instantly loaded.
if (!newFieldset.collapse) {
$scope.loadedFieldsets.push(newFieldset);
}
$scope.focusFieldset(newFieldset);
}
}
@@ -554,10 +565,10 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc
{
if(typeof fieldset.collapse === "undefined")
{
fieldset.collapse = true;
fieldset.collapse = $scope.model.config.enableCollapsing ? true : false;
}
return fieldset.collapse;
}
};
// added to track loaded fieldsets
$scope.loadedFieldsets = [];
@@ -601,6 +612,12 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc
//ini the fieldset expand/collapse
$scope.focusFieldset();
// Fieldsets which cannot be collapsed should start expanded.
_.each($scope.model.value.fieldsets, function(fieldset) {
fieldset.collapse = $scope.model.config.enableCollapsing;
});
$scope.loadedFieldsets = _.where($scope.model.value.fieldsets, { collapse: false });
//developerMode helpers
$scope.model.value.toString = stringify;
@@ -652,6 +669,9 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc
$scope.activeSubmitWatcher = 0;
// init loaded fieldsets tracking
_.each($scope.model.value.fieldsets, function (fieldset) {
fieldset.collapse = $scope.model.config.enableCollapsing ? true : false;
});
$scope.loadedFieldsets = _.where($scope.model.value.fieldsets, { collapse: false });
// create properties needed for the backoffice to work (data that is not serialized to DB)
+3 -3
View File
@@ -13,7 +13,7 @@ var ArchetypeSampleLabelTemplates = (function() {
var id = value.split(",")[0];
if (id) {
var entity = scope.services.archetypeLabelService.getEntityById(scope, id, args.entityType);
var entity = scope.services.archetypeCacheService.getEntityById(scope, id, args.entityType);
if(entity) {
return entity[args.propertyName];
@@ -34,13 +34,13 @@ var ArchetypeSampleLabelTemplates = (function() {
switch (value.type) {
case "content":
if(value.typeData.contentId) {
entity = scope.services.archetypeLabelService.getEntityById(scope, value.typeData.contentId, "Document");
entity = scope.services.archetypeCacheService.getEntityById(scope, value.typeData.contentId, "Document");
}
break;
case "media":
if(value.typeData.mediaId) {
entity = scope.services.archetypeLabelService.getEntityById(scope, value.typeData.mediaId, "Media");
entity = scope.services.archetypeCacheService.getEntityById(scope, value.typeData.mediaId, "Media");
}
break;
+12 -8
View File
@@ -2,7 +2,7 @@ angular.module('umbraco.services').factory('archetypeService', function () {
// Variables.
var draggedRteArchetype;
var rteClass = ".umb-rte textarea";
var rteClass = ".archetypeEditor .umb-rte textarea";
var editorSettings = {};
var disabledSortables = [];
@@ -75,10 +75,12 @@ angular.module('umbraco.services').factory('archetypeService', function () {
return reversed.join("-");
},
getFieldset: function(scope) {
return scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex];
var renderModel = scope.archetypeRenderModel;
return renderModel ? renderModel.fieldsets[scope.fieldsetIndex] : null;
},
getFieldsetProperty: function (scope) {
return this.getFieldset(scope).properties[scope.renderModelPropertyIndex];
var fieldset = this.getFieldset(scope);
return fieldset ? fieldset.properties[scope.renderModelPropertyIndex] : null;
},
setFieldsetValidity: function (fieldset) {
// mark the entire fieldset as invalid if there are any invalid properties in the fieldset, otherwise mark it as valid
@@ -146,10 +148,10 @@ angular.module('umbraco.services').factory('archetypeService', function () {
// Get the property's temporary ID.
var scope = angular.element(this).scope().$parent;
var property = self.getFieldsetProperty(scope);
var tempId = property.editorState.temporaryId;
var tempId = property ? property.editorState.temporaryId : null;
// Store the editor settings by the temporary ID?
if (editor && editor.settings) {
if (editor && editor.settings && tempId) {
editorSettings[tempId] = editor.settings;
}
@@ -180,12 +182,14 @@ angular.module('umbraco.services').factory('archetypeService', function () {
// Get the stored editor settings.
var scope = angular.element(this).scope().$parent;
var property = self.getFieldsetProperty(scope);
var tempId = property.editorState.temporaryId;
var tempId = property ? property.editorState.temporaryId : null;
var settings = editorSettings[tempId];
// Remove and reinitialize the editor.
tinyMCE.execCommand("mceRemoveEditor", false, id);
tinyMCE.init(settings);
if (settings) {
tinyMCE.execCommand("mceRemoveEditor", false, id);
tinyMCE.init(settings);
}
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Archetype",
"version": "1.13.0",
"version": "1.13.1",
"url": "http://github.com/imulus/archetype/",
"author": "Imulus - Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Et. Al.",
"authorUrl": "http://imulus.com/",