Rokasgrāmatas

Atrast rokasgrāmatu:
Izvēlies zīmolu
Visas
adidas
Converse
Lacoste
New Balance
New Era
Nike
Paez
Puma
Reebok
Timberland
Vans
Fila
Moon Boot
Alpha Industries
Jordan
ellesse
Helly Hansen
Pārējās rokasgrāmatas
Izvēlēties modeli
Visas
adidas Gazelle
adidas U_PATH
adidas Superstar
adidas Stan Smith
adidas NMD
adidas X_PLR
adidas EQT
adidas ZX Flux
Converse Chuck Taylor
New Balance 574
New Balance 997
Nike Air Force
Nike Air Max 720
Nike Air Max 270
Nike Air Max
Nike Cortez
Nike Roshe
Nike Huarache
Nike Stefan Janoski
Puma Suede
Puma Thunder Spectra
Puma Cali
Reebok Classic Leather
Timberland Premium 6
Fila Disruptor
adidas Deerupt
adidas Falcon
Vans Authentic
Nike M2K Tekno
Nike Zoom 2k
Reebok Aztrek
adidas Yung-96
Fila Ray Low
Jordan Air 1
Jordan Air 1
Vans Era
Converse Chuck 70
Nike Blazer
  
[script]$(document).ready(function () { /* Translations */ var labelChooseBrand = 'Izvēlies zīmolu'; var labelAll = 'Visas'; var labelOtherGuides = 'Pārējās rokasgrāmatas'; var labelSelectModel = 'Izvēlēties modeli'; /* Initial instructions */ var ddmModelContainer = $('#ddm-model.custom-select'); disableMenu(ddmModelContainer); cleanBrandsMenu(); sortMenuItems('#ddm-brand'); sortMenuItems('#ddm-model'); var guidesAll = $('.guide-name'); /* EVENT HANDLERS */ /* Toggling custom select menus' options */ $('#ddm-brand .select-selected').click(function () { $(this).siblings('.select-items').removeClass('select-hide'); $('#ddm-model.custom-select').children('.select-items').addClass('select-hide'); }); $('#ddm-model .select-selected').click(function () { $(this).siblings('.select-items').removeClass('select-hide'); $('#ddm-brand.custom-select').children('.select-items').addClass('select-hide'); }); $('.select-items div').click(function () { $(this).parent().addClass('select-hide'); $(this).parent().siblings('.select-selected').html($(this).html()); }); $('#ddm-brand .select-items div').click(function () { $(this).parent().siblings('.select-selected').attr('data-brand-selected', $(this).attr( 'data-brand')); }); document.addEventListener('click', closeAllSelect, true); /* Filtering brands */ $('#ddm-brand.custom-select div[data-brand]').click(function () { var attBrand = $(this).attr('data-brand'); attBrand = attBrand.replace('\'', ''); if (attBrand.indexOf('br-all') === 0) { $('.guide-name').slideDown(); disableMenu(ddmModelContainer); $('#ddm-model > .select-selected').html(labelSelectModel); } else if (attBrand.indexOf('br-other') === 0) { $('.guide-name a:not([data-brand*=\'' + attBrand + '\'])').parent().slideUp(); $('.guide-name a[data-brand*=\'' + attBrand + '\']').parent().slideDown(); disableMenu(ddmModelContainer); } else { $('#ddm-model > .select-selected').html(labelSelectModel); $('.guide-name a:not([data-brand*=\'' + attBrand + '\'])').parent().slideUp(); $('.guide-name a[data-brand*=\'' + attBrand + '\']').parent().slideDown(); ddmModelContainer.children('.select-selected').removeClass( 'select-disabled'); /* Cleaning options in models' menu */ if (attBrand.indexOf('br-other') !== 0) { $('#ddm-model.custom-select .select-items > div') .hide(); /* Showing only models of the chosen brand */ $('#ddm-model.custom-select .select-items > div[data-brand*=\'' + attBrand + '\'], #ddm-model.custom-select .select-items > div[data-model*=\'mo-all\']') .show(); /* Hiding models that don't have available guides */ cleanModelsMenu(); } } }); /* Filtering models */ $('#ddm-model.custom-select div[data-model]').click(function () { var attBrandSelected = $('#ddm-brand .select-selected').attr('data-brand-selected'); var attModel = $(this).attr('data-model'); attModel = attModel.replace('\'', ''); if ($(this).attr('data-model').indexOf('mo-all') !== 0) { $('.guide-name a:not([data-model*=\'' + attModel + '\'])').parent().slideUp(); $('.guide-name a[data-model*=\'' + attModel + '\']').parent().slideDown(); } else { $('.guide-name a[data-brand*=\'' + attBrandSelected + '\']').parent().slideDown(); } }); /* Handle input event */ var searchField = document.getElementById('si-search'); searchField.addEventListener('input', function () { if (this.value !== '') { $('#ddm-brand').children('.select-selected').addClass('select-disabled'); $('#ddm-model').children('.select-selected').addClass('select-disabled'); } else { $('#ddm-brand').children('.select-selected').removeClass('select-disabled'); resetBrandSelected(); } }); var searchIcon = document.getElementById('si-magn-glass').addEventListener('click', searchGuides); $(searchField).keypress(function (event) { if (event.keyCode === 13) { searchGuides(); } }); /* Functions */ function closeAllSelect() { $('.custom-select').children('.select-items').addClass('select-hide'); } function disableMenu(target) { target.children('.select-selected').addClass('select-disabled'); } function cleanBrandsMenu() { var collection = {}; var b = ''; var allMenuBrands = $('#ddm-brand div[data-brand]'); for (var i = 0; i < allMenuBrands.length; i++) { b = allMenuBrands[i].getAttribute('data-brand'); b = b.replace('\'', ''); if (b.indexOf('br-all') !== 0) { collection = $('.guide-name a[data-brand*=\'' + b + '\']'); if (collection.length !== null && collection !== null && collection.length === 0) { $('#ddm-brand div[data-brand*=\'' + b + '\']').hide(); } } } } function cleanModelsMenu() { var collection = {}; var m = ''; var allMenuModels = $('#ddm-model div[data-model]'); for (var i = 0; i < allMenuModels.length; i++) { m = allMenuModels[i].getAttribute('data-model'); m = m.replace('\'', ''); if (m.indexOf('mo-all') !== 0) { collection = $('.guide-name a[data-model*=\'' + m + '\']'); if (collection.length !== null && collection !== null && collection.length === 0) { $('#ddm-model div[data-model*=\'' + m + '\']').hide(); } } } } function sortMenuItems(id) { var arrItems = []; var items = $(id + ' div[data-brand]'); var br = (id.indexOf('#ddm-brand') === 0) ? 1 : 0; var elem = {}; for (var j = 1; j < (items.length - br); j++) { arrItems[j] = items[j]; } arrItems.sort(function (a, b) { var x = a.innerHTML.toLowerCase(); var y = b.innerHTML.toLowerCase(); if (x < y) { return -1; } else if (x > y) { return 1; } else { return 0; } }); var itemsContnr = $(id + ' .select-items'); itemsContnr.empty(); if (br === 1) { elem = document.createElement('div'); elem.dataset.brand = 'br-all'; elem.innerHTML = labelAll; itemsContnr.append(elem); } else { elem = document.createElement('div'); elem.dataset.brand = 'br-all'; elem.dataset.model = 'mo-all'; elem.innerHTML = labelAll; itemsContnr.append(elem); } for (j = 0; j < arrItems.length; j++) { itemsContnr.append(arrItems[j]); } if (br === 1) { elem = document.createElement('div'); elem.dataset.brand = 'br-other'; elem.innerHTML = labelOtherGuides; itemsContnr.append(elem); } } function resetBrandSelected() { var brandSelected = $('#ddm-brand .select-selected'); brandSelected.attr('data-brand-selected', 'br-all'); brandSelected.html(labelChooseBrand); $('#ddm-model > .select-selected').html(labelSelectModel); } function searchGuides() { var q = searchField.value.toLowerCase(); if (q === '' && guidesAll !== undefined) { $('.guide-name').slideDown(); disableMenu(ddmModelContainer); $('#ddm-model > .select-selected').html(labelSelectModel); resetBrandSelected(); } else { var s = false; var t = false; var hiddenCount = 0; for (var i = 0; i < guidesAll.length; i++) { s = guidesAll[i].children[0].innerText.toLowerCase(); if (s !== false && s !== '' && s.indexOf(q) >= 0) { t = guidesAll[i]; $(t).slideDown(); } else { t = guidesAll[i]; $(t).slideUp(); hiddenCount++; } } if (hiddenCount !== guidesAll.length && (window.innerWidth <= 680 || screen.width <= 680)) { document.getElementById('guides-list').scrollIntoView(true); window.scrollBy(0, -84); } } } });[/script]