Fix sorting of social icons in settings
This commit is contained in:
@@ -329,6 +329,12 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
SocialBlockSettingsIconCollectionView = Marionette.CollectionView.extend({
|
SocialBlockSettingsIconCollectionView = Marionette.CollectionView.extend({
|
||||||
|
behaviors: {
|
||||||
|
SortableBehavior: {
|
||||||
|
items: '> div',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
childViewContainer: '#mailpoet_social_icon_selector_contents',
|
||||||
childView: SocialBlockSettingsIconView,
|
childView: SocialBlockSettingsIconView,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -338,24 +344,12 @@ define([
|
|||||||
regions: {
|
regions: {
|
||||||
'icons': '#mailpoet_social_icon_selector_contents'
|
'icons': '#mailpoet_social_icon_selector_contents'
|
||||||
},
|
},
|
||||||
//childView: SocialBlockSettingsIconView,
|
|
||||||
//childViewContainer: '#mailpoet_social_icon_selector_contents',
|
|
||||||
events: {
|
events: {
|
||||||
'click .mailpoet_add_social_icon': 'addSocialIcon',
|
'click .mailpoet_add_social_icon': 'addSocialIcon',
|
||||||
},
|
},
|
||||||
modelEvents: {
|
modelEvents: {
|
||||||
'change:iconSet': 'render',
|
'change:iconSet': 'render',
|
||||||
},
|
},
|
||||||
behaviors: {
|
|
||||||
SortableBehavior: {
|
|
||||||
items: '#mailpoet_social_icon_selector_contents > div',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
//constructor: function() {
|
|
||||||
//// Set the icon collection to be handled by this view as well
|
|
||||||
//arguments[0].collection = arguments[0].model.get('icons');
|
|
||||||
//Marionette.CompositeView.apply(this, arguments);
|
|
||||||
//},
|
|
||||||
addSocialIcon: function() {
|
addSocialIcon: function() {
|
||||||
// Add a social icon with default values
|
// Add a social icon with default values
|
||||||
this.model.get('icons').add({});
|
this.model.get('icons').add({});
|
||||||
|
Reference in New Issue
Block a user