Skip to content

Commit

Permalink
Less: Add T3ImagePath and T3ThemeImagePath for image folder
Browse files Browse the repository at this point in the history
T3ImagePath and T3ThemeImage path must redefine on each theme
  • Loading branch information
joomlart committed Apr 11, 2013
1 parent b31a298 commit 0ae91dd
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 32 deletions.
56 changes: 31 additions & 25 deletions source/plg_system_t3/base/js/off-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,28 @@
if (!$.browser.msie || $.browser.version >= 9) {
$(document).ready(function(){
var $btn = $('.btn-navbar'),
$nav = null,
$fixeditems = null;
if (!$btn.length) return ;
$nav = $('<div class="t3-mainnav" />').appendTo($('<div id="off-canvas-nav"></div>').appendTo($('body')));
$($btn.data('target')).clone().appendTo ($nav);
$nav = null,
$fixeditems = null;

if (!$btn.length) return;

$nav = $('<div class="t3-mainnav" />').appendTo($('<div id="off-canvas-nav"></div>').appendTo(document.body));
$($btn.data('target')).clone().appendTo($nav);
$('html').addClass ('off-canvas');
$('.btn-navbar').click (function(e){
var $this = $(this);
if ($this.data('off-canvas') == 'show') {

$btn.click (function(e){
if ($(this).data('off-canvas') == 'show') {
hideNav();
} else {
showNav();
}

return false;
});

posNav = function () {
var t = $(window).scrollTop();
if (t < $nav.position().top) $nav[0].style.top = t+'px';
if (t < $nav.position().top) $nav.css('top', t);
};

bdHideNav = function (e) {
Expand All @@ -43,21 +46,23 @@
};

showNav = function () {
var t = $(window).scrollTop(),
$mainnav = $('#t3-mainnav');
$nav[0].style.top = t+'px';
$nav.css('top', $(window).scrollTop());
wpfix(1);
setTimeout (function(){
$('.btn-navbar').data('off-canvas', 'show');
$('html').addClass ('off-canvas-enabled');
$(window).bind('scroll touchmove', posNav);
// hide when click on off-canvas-nav
$('#off-canvas-nav').bind ('click', function (e) {
e.stopPropagation();
});
$('#off-canvas-nav a').bind ('click', hideNav);
$('body').bind ('click', bdHideNav);
}, 50);

setTimeout (function(){
$btn.data('off-canvas', 'show');
$('html').addClass ('off-canvas-enabled');
$(window).bind('scroll touchmove', posNav);

// hide when click on off-canvas-nav
$('#off-canvas-nav').bind ('click', function (e) {
e.stopPropagation();
});

$('#off-canvas-nav a').bind ('click', hideNav);
$('body').bind ('click', bdHideNav);
}, 50);

setTimeout (function(){
wpfix(2);
}, 1000);
Expand All @@ -66,11 +71,12 @@
hideNav = function () {
$(window).unbind('scroll touchmove', posNav);
$('#off-canvas-nav').unbind ('click');
$('body').unbind ('click', bdHideNav);
$('#off-canvas-nav a').unbind ('click', hideNav);
$('body').unbind ('click', bdHideNav);

$('html').removeClass ('off-canvas-enabled');
$('.btn-navbar').data('off-canvas', 'hide');
$btn.data('off-canvas', 'hide');

setTimeout (function(){
}, 1000);
};
Expand Down
2 changes: 1 addition & 1 deletion source/tpl_t3_blank/less/home.less
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

// arrow
.section-arrow-alt {
background: url(../images/arrow-section-alt.png) no-repeat center -1px @grayLighter;
background: url("@{T3ImagePath}/arrow-section-alt.png") no-repeat center -1px @grayLighter;
width: 37px;
height: 19px;
position: absolute;
Expand Down
3 changes: 1 addition & 2 deletions source/tpl_t3_blank/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
}

.input {
background: url(../images/ico/search-invert.png) no-repeat 8px center;
background: url("@{T3ImagePath}/ico/search-invert.png") no-repeat 8px center;
width: 120px;
padding-left: 26px;
// focus state
Expand All @@ -115,7 +115,6 @@
width: 180px;
}
}

}


Expand Down
2 changes: 1 addition & 1 deletion source/tpl_t3_blank/less/themes/dark/template.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
// -----------

.head-search .input {
background: url(../../../images/ico/dark/search.png) no-repeat 8px center;
background: url("@{T3ThemeImagePath}/ico/search.png") no-repeat 8px center;
}

/* focus state */
Expand Down
4 changes: 4 additions & 0 deletions source/tpl_t3_blank/less/themes/dark/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*------------------------------------------------------------------------------
*/

// Global values
// --------------------------------------------------
@T3ImagePath: "../../../images";
@T3ThemeImagePath: "@{T3ImagePath}/themes/dark";

// Scaffolding
// -------------------------
Expand Down
4 changes: 2 additions & 2 deletions source/tpl_t3_blank/less/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// Global values
// --------------------------------------------------

@T3ImagePath: "../images";

// Grays
// -------------------------
Expand Down Expand Up @@ -361,7 +361,7 @@
@T3logoWidth: 204px;
@T3logoHeight: 65px;

@T3LogoImage: "../images/logo.png";
@T3LogoImage: "@{T3ImagePath}/logo.png";



Expand Down
2 changes: 1 addition & 1 deletion source/tpl_t3_blank/tpls/blocks/head.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
?>

<!-- META FOR IOS & HANDHELD -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, <?php echo $this->getParam('responsive', 1) ? 'maximum-scale=1.0, user-scalable=no' : '' ?>"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0<?php echo $this->getParam('responsive', 1) ? ', maximum-scale=1.0, user-scalable=no' : '' ?>"/>
<meta name="HandheldFriendly" content="true" />
<meta name="apple-mobile-web-app-capable" content="YES" />
<!-- //META FOR IOS & HANDHELD -->
Expand Down

0 comments on commit 0ae91dd

Please sign in to comment.