mirror of
https://github.com/pierre42100/comunic
synced 2024-11-16 18:41:13 +00:00
39 lines
962 B
JavaScript
Executable File
39 lines
962 B
JavaScript
Executable File
(function( $ ) {
|
|
$.widget("metro.pullmenu", {
|
|
|
|
version: "1.0.0",
|
|
|
|
options: {
|
|
},
|
|
|
|
_create: function(){
|
|
var that = this,
|
|
element = this.element;
|
|
|
|
var menu = (element.data("relation") != undefined) ? element.data("relation") : element.parent().children(".element-menu, .horizontal-menu");
|
|
|
|
addTouchEvents(element[0]);
|
|
|
|
element.on("click", function(e){
|
|
menu.slideToggle();
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
});
|
|
|
|
},
|
|
|
|
_destroy: function(){
|
|
|
|
},
|
|
|
|
_setOption: function(key, value){
|
|
this._super('_setOption', key, value);
|
|
}
|
|
})
|
|
})( jQuery );
|
|
|
|
$(window).resize(function(){
|
|
var device_width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
|
|
if (device_width > 800) {$(".element-menu").show();} else {$(".element-menu").hide();}
|
|
});
|