Skip to content

Commit

Permalink
Removes old responsive toggle button.
Browse files Browse the repository at this point in the history
  • Loading branch information
kylephillips committed May 26, 2018
1 parent b1643ca commit 9f9fe9e
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 152 deletions.
8 changes: 3 additions & 5 deletions app/Views/partials/row-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
?>
<div class="row" <?php if ( $this->listing_repo->isSearch() ) echo 'style="padding-left:10px;"';?>>

<?php if ( $this->post_type->hierarchical && !$this->listing_repo->isSearch() ) : ?>
<div class="child-toggle"></div>
<?php endif; ?>
<div class="child-toggle">
<div class="child-toggle-spacer"></div>
</div>

<div class="row-inner">

Expand Down Expand Up @@ -47,8 +47,6 @@
?>
</a>

<a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>

<div class="action-buttons">

<a href="#"
Expand Down
3 changes: 0 additions & 3 deletions app/Views/partials/row.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@

<?php echo $this->rowActions($assigned_pt); ?>

<!-- Responsive Toggle Button -->
<a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>

<?php if ( !$this->post->hierarchical ) : echo $this->post->hierarchical; ?>
<div class="np-post-columns">
<ul class="np-post-info">
Expand Down
2 changes: 1 addition & 1 deletion assets/css/nestedpages.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/js/lib/nestedpages-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ NestedPages.Factory = function()
var $ = jQuery;

plugin.formatter = new NestedPages.Formatter;
plugin.responsive = new NestedPages.Responsive;
plugin.dropdowns = new NestedPages.Dropdowns;
plugin.modals = new NestedPages.Modals;
plugin.checkAll = new NestedPages.CheckAll;
Expand Down
55 changes: 0 additions & 55 deletions assets/js/lib/nestedpages-responsive.js

This file was deleted.

2 changes: 1 addition & 1 deletion assets/js/lib/nestedpages.menu-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ NestedPages.MenuLinks = function()
html += '<a href="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.menuTitle + ' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></span>';

// Quick Edit Button
html += '</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
html += '</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
html += 'data-id="' + plugin.post.id + '"';
html += 'data-parentid="' + plugin.post.parent_id + '"';
html += 'data-title="' + plugin.post.menuTitle + '" ';
Expand Down
2 changes: 1 addition & 1 deletion assets/js/lib/nestedpages.new-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ NestedPages.NewPost = function()
}
html += '</span>';

html += '<span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>';
html += '<span class="edit-indicator">Edit</span>';
html += '</a>';

// Non-Hierarchical Data
Expand Down
60 changes: 2 additions & 58 deletions assets/js/nestedpages.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
var NestedPages = NestedPages || {};

/**
* Responsive functionality for nested view
* @package Nested Pages
* @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
*/
NestedPages.Responsive = function()
{
var plugin = this;
var $ = jQuery;

plugin.init = function()
{
plugin.bindEvents();
}

plugin.bindEvents = function()
{
$(document).on('click', NestedPages.selectors.toggleEditButtons, function(e){
e.preventDefault();
plugin.toggleEdit($(this));
});
// Remove the block display when sizing up
$(window).resize(function() {
plugin.timer(function(){
$('.action-buttons').removeAttr('style');
$('.np-toggle-edit').removeClass('active');
}, 500);
});
}

// Toggle the responsive edit buttons
plugin.toggleEdit = function(button)
{
var buttons = $(button).siblings('.action-buttons');
if ( $(buttons).is(':visible') ){
$(button).removeClass('active');
$(buttons).hide();
return;
}
$(button).addClass('active');
$(buttons).show();
}

plugin.timer = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();

return plugin.init();
}
var NestedPages = NestedPages || {};

/**
* Formatting updates
* @package Nested Pages
Expand Down Expand Up @@ -1444,7 +1389,7 @@ NestedPages.NewPost = function()
}
html += '</span>';

html += '<span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>';
html += '<span class="edit-indicator">Edit</span>';
html += '</a>';

// Non-Hierarchical Data
Expand Down Expand Up @@ -2575,7 +2520,6 @@ NestedPages.Factory = function()
var $ = jQuery;

plugin.formatter = new NestedPages.Formatter;
plugin.responsive = new NestedPages.Responsive;
plugin.dropdowns = new NestedPages.Dropdowns;
plugin.modals = new NestedPages.Modals;
plugin.checkAll = new NestedPages.CheckAll;
Expand Down Expand Up @@ -2882,7 +2826,7 @@ NestedPages.MenuLinks = function()
html += '<a href="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.menuTitle + ' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></span>';

// Quick Edit Button
html += '</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
html += '</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
html += 'data-id="' + plugin.post.id + '"';
html += 'data-parentid="' + plugin.post.parent_id + '"';
html += 'data-title="' + plugin.post.menuTitle + '" ';
Expand Down
2 changes: 1 addition & 1 deletion assets/js/nestedpages.min.js

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions assets/scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,4 @@
background-color: darken($red, 15%);
border-color: darken($red, 15%);
}
}

// Toggle button for edit buttons (responsive)
.np-toggle-edit {
display: none;
float: right;
margin-right: 10px;
position: relative;
top: 9px;
@extend .np-btn;
&.active {
background-color: $blue;
color: $white;
box-shadow: none;
border-color: $blue;
}
}
@media (max-width: 767px)
{
.np-toggle-edit {
display: inline-block;
}
}
3 changes: 0 additions & 3 deletions assets/scss/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
-moz-osx-font-smoothing: grayscale;
}

.np-icon-pencil:before {
content: "\e254";
}
.np-icon-no:before {
content: "\e601";
}
Expand Down
1 change: 0 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var scss = 'assets/scss/**/*';
var css = 'assets/css/';

var js_source = [
'assets/js/lib/nestedpages-responsive.js',
'assets/js/lib/nestedpages.formatter.js',
'assets/js/lib/nestedpages.dropdowns.js',
'assets/js/lib/nestedpages.modals.js',
Expand Down

0 comments on commit 9f9fe9e

Please sign in to comment.