Skip to content

Commit

Permalink
Move plugin to root on Github
Browse files Browse the repository at this point in the history
  • Loading branch information
awps committed Jun 20, 2017
1 parent ad35be5 commit 7d76221
Show file tree
Hide file tree
Showing 59 changed files with 1,106 additions and 422 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions assets/js-plugins/font/font.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
Font
-------------------------------------------------------------------------------
*/
prepareFontsList: function(){
var _width = $('#customize-controls').outerWidth();
console.log( _width );
$('.zerowpc-fonts').css({
'left': _width
});
},

addSelectedFont: function( selected_elem_from_list, parent_block ){
var font_class = selected_elem_from_list.attr('class');
var font_title = selected_elem_from_list.attr('title');
Expand Down Expand Up @@ -68,14 +76,14 @@
$('.zerowpc-fonts').hide();

_this.toggleClass('active');
_this.parents('.zerowpc-fonts-block').find('.zerowpc-fonts').toggle();
$('.zerowpc-fonts').toggle();

//scroll to selected
var the_parent = _this.parents('.zerowpc-fonts-block').find('.zerowpc-fonts ul');
var target = _this.find('.zerowpc-font-item').attr('title');
var element = _this.parents('.zerowpc-fonts-block').find('.zerowpc-fonts ul li[title="' + target + '"]');
var the_parent = $('.zerowpc-fonts ul');
var target = the_parent.find('.zerowpc-font-item').attr('title');
var element = $('.zerowpc-fonts ul li[title="' + target + '"]');

the_parent.scrollTop( the_parent.scrollTop()+element.position().top-20 );
the_parent.scrollTop( the_parent.scrollTop()+element.position().top-60 );
});

//Cache the container
Expand All @@ -88,7 +96,7 @@
&& $('.zerowpc-fonts').has(event.target).length === 0 // ... nor a descendant of the fonts list
&& container.has(event.target).length === 0){// ... nor a descendant of the container
container.removeClass('active');
container.parents('.zerowpc-fonts-block').find('.zerowpc-fonts').hide();
$('.zerowpc-fonts').hide();
}
});

Expand Down Expand Up @@ -182,6 +190,7 @@
__construct: function(){
self = this;

self.prepareFontsList();
self.showFontsList();
self.buildFonts();
self.searchFonts();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
top: 0;
bottom: 0;
left: 300px;
padding: 53px 0 0 0;
padding: 40px 0 0 0;
margin: 0;
border-right: 1px solid #ccc;
background: #fff;
Expand Down Expand Up @@ -118,7 +118,7 @@
}
/* Search field
------------------------------------------------*/
.customize-control input[type=text].zerowpc-fonts-search-field{
input[type=text].zerowpc-fonts-search-field{
width: 210px;
margin: 10px;
border: 1px solid #aaa;
Expand Down
File renamed without changes

0 comments on commit 7d76221

Please sign in to comment.