Re-enabled check for if the sort checkbox is enabled

Re-enabled removal code if the page sort does not have a previous and/or
next

Spacing corrections
This commit is contained in:
Ed Chipman 2015-09-06 20:48:10 -03:00
parent fae85f04c1
commit 089d4e796d
3 changed files with 55 additions and 55 deletions

View File

@ -42,31 +42,31 @@
} }
.cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-psort-arrow i { .cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-psort-arrow i {
display: block; display: block;
position: relative; position: relative;
position: absolute; position: absolute;
top: 50%; top: 50%;
white-space: nowrap; white-space: nowrap;
} }
.cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-psort-arrow i:before { .cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-psort-arrow i:before {
display: block; display: block;
content: " "; content: " ";
position: absolute; position: absolute;
top: -30px; top: -30px;
left: 50%; left: 50%;
height: 0; height: 0;
width: 0; width: 0;
border: solid transparent; border: solid transparent;
border-width: 14px; border-width: 14px;
border-bottom-color: #FFFFFF; border-bottom-color: #FFFFFF;
margin-left: -8px; margin-left: -8px;
} }
@ -82,19 +82,19 @@
} }
.cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-prev-page i { .cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-prev-page i {
left: 20px; left: 20px;
-o-transform: rotate(270deg) translateX(-50%); -o-transform: rotate(270deg) translateX(-50%);
-ms-transform: rotate(270deg) translateX(-50%); -ms-transform: rotate(270deg) translateX(-50%);
-moz-transform: rotate(270deg) translateX(-50%); -moz-transform: rotate(270deg) translateX(-50%);
-webkit-transform: rotate(270deg) translateX(-50%); -webkit-transform: rotate(270deg) translateX(-50%);
transform: rotate(270deg) translateX(-50%); transform: rotate(270deg) translateX(-50%);
-o-transform-origin: top left; -o-transform-origin: top left;
-ms-transform-origin: top left; -ms-transform-origin: top left;
-moz-transform-origin: top left; -moz-transform-origin: top left;
-webkit-transform-origin: top left; -webkit-transform-origin: top left;
transform-origin: top left; transform-origin: top left;
} }
.cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-next-page { .cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-next-page {
@ -102,19 +102,19 @@
} }
.cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-next-page i { .cms .ss-gridfield .gridfield-sortablerows-movepage .sortablerows-next-page i {
right: 36px; right: 36px;
-moz-transform: rotate(90deg) translateX(50%); -moz-transform: rotate(90deg) translateX(50%);
-o-transform: rotate(90deg) translateX(50%); -o-transform: rotate(90deg) translateX(50%);
-ms-transform: rotate(90deg) translateX(50%); -ms-transform: rotate(90deg) translateX(50%);
-webkit-transform: rotate(90deg) translateX(50%); -webkit-transform: rotate(90deg) translateX(50%);
transform: rotate(90deg) translateX(50%); transform: rotate(90deg) translateX(50%);
-o-transform-origin: bottom right; -o-transform-origin: bottom right;
-ms-transform-origin: bottom right; -ms-transform-origin: bottom right;
-moz-transform-origin: bottom right; -moz-transform-origin: bottom right;
-webkit-transform-origin: bottom right; -webkit-transform-origin: bottom right;
transform-origin: bottom right; transform-origin: bottom right;
} }
.cms table.ss-gridfield-table.dragSorting tbody tr td { .cms table.ss-gridfield-table.dragSorting tbody tr td {

View File

@ -28,7 +28,7 @@
return ui; return ui;
}, },
start: function(event, ui) { start: function(event, ui) {
pageArrows.show(); pageArrows.show();
pageArrows.startMoveTracking(); pageArrows.startMoveTracking();
}, },
stop: function(event, ui) { stop: function(event, ui) {
@ -36,7 +36,7 @@
pageArrows.hide(); pageArrows.hide();
}, },
sort: function(event, ui) { sort: function(event, ui) {
pageArrows.moveTracking(event, ui); pageArrows.moveTracking(event, ui);
}, },
update: function(event, ui) { update: function(event, ui) {
if(self.getPageSort()) { if(self.getPageSort()) {
@ -122,13 +122,13 @@
var sortableCheckbox=gridField.find('.gridfield-sortablerows input'); var sortableCheckbox=gridField.find('.gridfield-sortablerows input');
var self=$(this); var self=$(this);
/*if($(this).hasClass('sortablerows-prev-page') && gridField.find('.ss-gridfield-previouspage').is(':disabled')) { if($(this).hasClass('sortablerows-prev-page') && gridField.find('.ss-gridfield-previouspage').is(':disabled')) {
$(this).remove(); $(this).remove();
return; return;
}else if($(this).hasClass('sortablerows-next-page') && gridField.find('.ss-gridfield-nextpage').is(':disabled')) { }else if($(this).hasClass('sortablerows-next-page') && gridField.find('.ss-gridfield-nextpage').is(':disabled')) {
$(this).remove(); $(this).remove();
return; return;
}*/ }
$(this).droppable({ $(this).droppable({
disabled: $(this).is(':disabled'), disabled: $(this).is(':disabled'),
@ -184,20 +184,20 @@
self.setArrowIcon(self.find('i')); self.setArrowIcon(self.find('i'));
}, },
stopMoveTracking: function() { stopMoveTracking: function() {
$(this).setArrowIcon(null); $(this).setArrowIcon(null);
}, },
moveTracking: function(e, ui) { moveTracking: function(e, ui) {
var self=$(this); var self=$(this);
var arrowIcon=self.getArrowIcon(); var arrowIcon=self.getArrowIcon();
if(arrowIcon) { if(arrowIcon) {
var selfOffset=self.offset().top; var selfOffset=self.offset().top;
var arrowIconHeight=arrowIcon.width()+10; var arrowIconHeight=arrowIcon.width()+10;
var railHeight=self.height()-arrowIconHeight; var railHeight=self.height()-arrowIconHeight;
var helperPos=ui.helper.offset().top; var helperPos=ui.helper.offset().top;
if(helperPos>selfOffset+10 && helperPos<selfOffset+railHeight) { if(helperPos>selfOffset+10 && helperPos<selfOffset+railHeight) {
arrowIcon.css('top', ((helperPos-selfOffset)+arrowIconHeight/2)+'px'); arrowIcon.css('top', ((helperPos-selfOffset)+arrowIconHeight/2)+'px');
} }
} }
} }
}); });

View File

@ -1,7 +1,7 @@
<%-- if $Checked --%> <% if $Checked %>
<div class="gridfield-sortablerows-movepage" colspan="$Colspan"> <div class="gridfield-sortablerows-movepage" colspan="$Colspan">
<a href="" class="sortablerows-psort-arrow sortablerows-prev-page"><i><%t GridFieldSortableRows.PREVIOUS '_Move to Previous Page' %></i></a> <a href="" class="sortablerows-psort-arrow sortablerows-prev-page"><i><%t GridFieldSortableRows.PREVIOUS '_Move to Previous Page' %></i></a>
<a href="" class="sortablerows-psort-arrow sortablerows-next-page"><i><%t GridFieldSortableRows.NEXT '_Move to Next Page' %></i></a> <a href="" class="sortablerows-psort-arrow sortablerows-next-page"><i><%t GridFieldSortableRows.NEXT '_Move to Next Page' %></i></a>
</div> </div>
<%-- end_if --%> <% end_if %>