apostrophe-blocks
Advanced tools
Comparing version 0.5.47 to 0.5.48
{ | ||
"name": "apostrophe-blocks", | ||
"version": "0.5.47", | ||
"version": "0.5.48", | ||
"description": "Allows a column of content to be broken up into blocks with independent templates, allowing for sub-columns to alternate with a full width column for instance. Blocks can be added and removed freely.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,33 +17,27 @@ function AposBlocks() { | ||
// listen for editor modifier keys | ||
var modifierOn = false; | ||
$('body').on('keydown', function(e) { | ||
if (e.keyCode === 16) { | ||
$('[data-move-block]').each(function() { | ||
var $self = $(this); | ||
if ($self.attr('data-move-block') === 'up') { | ||
$self.children('i').toggleClass('icon-double-angle-up'); | ||
$self.attr('data-move-block', 'top'); | ||
} else if ($self.attr('data-move-block') === 'down') { | ||
$self.children('i').toggleClass('icon-double-angle-down'); | ||
$self.attr('data-move-block', 'bottom'); | ||
} | ||
modifierOn = true; | ||
}); | ||
} | ||
apos.on('shiftDown', function() { | ||
$('[data-move-block]').each(function() { | ||
var $self = $(this); | ||
if ($self.attr('data-move-block') === 'up') { | ||
$self.children('i').toggleClass('icon-double-angle-up'); | ||
$self.attr('data-move-block', 'top'); | ||
} else if ($self.attr('data-move-block') === 'down') { | ||
$self.children('i').toggleClass('icon-double-angle-down'); | ||
$self.attr('data-move-block', 'bottom'); | ||
} | ||
}); | ||
}); | ||
$('body').on('keyup', function(e) { | ||
if (modifierOn === true) { | ||
$('[data-move-block]').each(function() { | ||
var $self = $(this); | ||
$self.children('i').removeClass('icon-double-angle-up'); | ||
$self.children('i').removeClass('icon-double-angle-down'); | ||
if ($self.attr('data-move-block') === 'top') { | ||
$self.attr('data-move-block', 'up'); | ||
} else if ($self.attr('data-move-block') === 'bottom') { | ||
$self.attr('data-move-block', 'down'); | ||
} | ||
modifierOn = false; | ||
}); | ||
} | ||
apos.on('shiftUp', function() { | ||
$('[data-move-block]').each(function() { | ||
var $self = $(this); | ||
$self.children('i').removeClass('icon-double-angle-up'); | ||
$self.children('i').removeClass('icon-double-angle-down'); | ||
if ($self.attr('data-move-block') === 'top') { | ||
$self.attr('data-move-block', 'up'); | ||
} else if ($self.attr('data-move-block') === 'bottom') { | ||
$self.attr('data-move-block', 'down'); | ||
} | ||
}); | ||
}); | ||
@@ -50,0 +44,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26919
488