Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CSS-Tricks/The-Printliminator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMottie <wowmotty@gmail.com>2015-09-15 20:21:49 +0300
committerMottie <wowmotty@gmail.com>2015-09-15 20:21:49 +0300
commit042076c9ffcb7711fb94c65937b7751519321ee5 (patch)
tree9ec77530079b2ed28dc2840a8def7bfeb068900b /src
parent91a36cb9591531cbd5b2f3969f5badbac77c6359 (diff)
Add missing shift-click functionality
Diffstat (limited to 'src')
-rw-r--r--src/printliminator.js35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/printliminator.js b/src/printliminator.js
index 09334b1..42ad663 100644
--- a/src/printliminator.js
+++ b/src/printliminator.js
@@ -295,22 +295,33 @@ var pl = {
var done, sel,
hilite = document.querySelector( '.' + pl.css.hilite );
- // show opposite (Alt + click)
- if ( event[ pl.keys.opposite ] ) {
- done = pl.getOpposite( hilite );
- sel = done.length;
- if ( !sel ) {
- // nothing left to remove
- return false;
+
+ // Make 100% width & zero margins (set by css)
+ // Shift + click
+ if ( event[ pl.keys.fullWidth ] ) {
+ if ( !pl.hasClass( hilite, pl.css.fullWidth ) ) {
+ pl.addClass( hilite, pl.css.fullWidth );
+ csstricksPrintliminatorVars.history.push( function() {
+ pl.removeClass( hilite, pl.css.fullWidth );
+ });
}
} else {
- // hide clicked element
- done = [ hilite ];
+ // show opposite (Alt + click)
+ if ( event[ pl.keys.opposite ] ) {
+ done = pl.getOpposite( hilite );
+ sel = done.length;
+ if ( !sel ) {
+ // nothing left to remove
+ return false;
+ }
+ } else {
+ // hide clicked element
+ done = [ hilite ];
+ }
+ pl.hide( done );
+ csstricksPrintliminatorVars.history.push( done );
}
- pl.hide( done );
- csstricksPrintliminatorVars.history.push( done );
-
// remove any text selection
pl.clearSelection();