ymaps.ready(init);
//Set default center and zoom
function init() {
myMap = new ymaps.Map('map_page', {
center: [45.0701, 38.9048],
zoom: 9
});
//Set user Icon
s = {
iconLayout: 'default#image',
iconImageHref: '/wp-content/themes/okhall/img/logo-map.svg',
iconImageSize: [87, 74],
iconImageOffset: [-43, -56]
};
//Set some points
m = {
m1: new ymaps.Placemark([45.0710, 38.9038], {}, s),
m1center: [45.0701, 38.9048],
m2: new ymaps.Placemark([45.0349, 39.1317], {}, s),
m2center: [45.0349, 39.1317],
m3: new ymaps.Placemark([44.7491, 37.7263], {}, s),
m3center: [44.7491, 37.7265],
m4: new ymaps.Placemark([45.2299, 38.1138], {}, s),
m4center: [45.2299, 38.1138],
m5: new ymaps.Placemark([45.8417, 40.1357], {}, s),
m5center: [45.8417, 40.1357],
m6: new ymaps.Placemark([44.9367, 37.9675], {}, s),
m6center: [44.9367, 37.9675]
};
//Disabled scroll
//myMap.behaviors.disable('scrollZoom');
//on mobile disable touch
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
//... отключаем перетаскивание карты
myMap.behaviors.disable('drag');
}
//Add points on the map
myMap.geoObjects
.add(m['m1'])
.add(m['m2'])
.add(m['m3'])
.add(m['m4'])
.add(m['m5'])
.add(m['m6']);
// ON RESIZE
//Get curent center and zoom
var pixelCenter = myMap.getGlobalPixelCenter('map_page');
console.log(pixelCenter);
//
function onResizeMap() {
if ($(window).width() > '992') {
//Set New center
myMap.setCenter([45.0701, 37.0048]);
var pixelCenter2 = myMap.getGlobalPixelCenter('map_page');
console.log(pixelCenter2);
} else {
myMap.setCenter([45.0701, 38.9048]);
}
} onResizeMap();
window.onresize = function () {
onResizeMap();
};
}; import debounce from "lodash/debounce";
const TIME_OUT = 1000;
const handleSearch = debounce(({ target: { value } = {} }) => {
//что-то делаем
}, TIME_OUT)
$yourInput.addEventListener("input", handleSearch, false);
$roles = User::where('id', '1')->first()->roles();...->get(), либо сразу вызывай ->roles:$roles = User::where('id', '1')->first()->roles()->get();
$roles = User::where('id', '1')->first()->roles;В обоих случаях $roles будет хранить коллекцию ролей, а не просто запрос. $ git status
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: myfilegit checkout myfilegit checkout abcde myfile # abcde — хеш коммита
# или
git checkout feature3 myfile # feature3 — имя ветки
var Target = $('.selected'); // запоминаем DOM-элемент
Target.removeClass('selected'); // удаляем
Target.addClass('selected'); // добавляем