Closes #193 - inline components work
This commit is contained in:
@@ -12433,29 +12433,31 @@ $(function() {
|
||||
|
||||
// Sortable components.
|
||||
var componentList = document.getElementById("component-list");
|
||||
new Sortable(componentList, {
|
||||
group: "omega",
|
||||
handle: ".drag-handle",
|
||||
onUpdate: function() {
|
||||
// Loop each component, setting the order input to the new order.
|
||||
var $components = $('#component-list .striped-list-item');
|
||||
$.each($components, function(id) {
|
||||
// Order should start from 1 now.
|
||||
$(this).find('input[rel=order]').val(id + 1);
|
||||
});
|
||||
if (componentList) {
|
||||
new Sortable(componentList, {
|
||||
group: "omega",
|
||||
handle: ".drag-handle",
|
||||
onUpdate: function() {
|
||||
// Loop each component, setting the order input to the new order.
|
||||
var $components = $('#component-list .striped-list-item');
|
||||
$.each($components, function(id) {
|
||||
// Order should start from 1 now.
|
||||
$(this).find('input[rel=order]').val(id + 1);
|
||||
});
|
||||
|
||||
// Now POST the form to the internal API.
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: '/dashboard/api/components/order',
|
||||
type: 'POST',
|
||||
data: $('form[name=componentList]').serializeObject(),
|
||||
success: function() {
|
||||
(new CachetHQ.Notifier).notify('Components updated.', 'success');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// Now POST the form to the internal API.
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: '/dashboard/api/components/order',
|
||||
type: 'POST',
|
||||
data: $('form[name=componentList]').serializeObject(),
|
||||
success: function() {
|
||||
(new CachetHQ.Notifier).notify('Components updated.', 'success');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Toggle inline component statuses.
|
||||
$('form.component-inline').on('click', 'input[type=radio]', function() {
|
||||
@@ -12475,4 +12477,11 @@ $(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Banner removal JS
|
||||
$('#remove-banner').click(function(){
|
||||
$('#banner-view').remove();
|
||||
$('input[name=remove_banner]').val('1');
|
||||
$('#settings-form').submit();
|
||||
});
|
||||
});
|
||||
@@ -12433,29 +12433,31 @@ $(function() {
|
||||
|
||||
// Sortable components.
|
||||
var componentList = document.getElementById("component-list");
|
||||
new Sortable(componentList, {
|
||||
group: "omega",
|
||||
handle: ".drag-handle",
|
||||
onUpdate: function() {
|
||||
// Loop each component, setting the order input to the new order.
|
||||
var $components = $('#component-list .striped-list-item');
|
||||
$.each($components, function(id) {
|
||||
// Order should start from 1 now.
|
||||
$(this).find('input[rel=order]').val(id + 1);
|
||||
});
|
||||
if (componentList) {
|
||||
new Sortable(componentList, {
|
||||
group: "omega",
|
||||
handle: ".drag-handle",
|
||||
onUpdate: function() {
|
||||
// Loop each component, setting the order input to the new order.
|
||||
var $components = $('#component-list .striped-list-item');
|
||||
$.each($components, function(id) {
|
||||
// Order should start from 1 now.
|
||||
$(this).find('input[rel=order]').val(id + 1);
|
||||
});
|
||||
|
||||
// Now POST the form to the internal API.
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: '/dashboard/api/components/order',
|
||||
type: 'POST',
|
||||
data: $('form[name=componentList]').serializeObject(),
|
||||
success: function() {
|
||||
(new CachetHQ.Notifier).notify('Components updated.', 'success');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// Now POST the form to the internal API.
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: '/dashboard/api/components/order',
|
||||
type: 'POST',
|
||||
data: $('form[name=componentList]').serializeObject(),
|
||||
success: function() {
|
||||
(new CachetHQ.Notifier).notify('Components updated.', 'success');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Toggle inline component statuses.
|
||||
$('form.component-inline').on('click', 'input[type=radio]', function() {
|
||||
@@ -12475,4 +12477,11 @@ $(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Banner removal JS
|
||||
$('#remove-banner').click(function(){
|
||||
$('#banner-view').remove();
|
||||
$('input[name=remove_banner]').val('1');
|
||||
$('#settings-form').submit();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"css/all.css": "css/all-c5b65085.css",
|
||||
"js/all.js": "js/all-337c2216.js"
|
||||
"js/all.js": "js/all-215df44c.js"
|
||||
}
|
||||
Reference in New Issue
Block a user