openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

jquery-plugin-orButton.js (579B)


      1 import $ from "../jquery-global.js";
      2 
      3 /**
      4  * JQuery-Plugin, enable opening an area.
      5  */
      6 export default function( options )
      7 {
      8 	// Create some defaults, extending them with any options that were provided
      9 	let settings = $.extend( {
     10 		'selectorForClose': '.or-view'
     11 	}, options);
     12 
     13 	let button = this;
     14 
     15 	$( settings.selectorForClose ).click( function() {
     16 		// Closing all dropdowns on any click.
     17 		//$(button).removeClass('button--is-active');
     18 	});
     19 
     20 	return $(this)
     21 		.addClass('button--is-watched')
     22 		.click( function() {
     23 			$(this).toggleClass('button--is-active');
     24 		} ) ;
     25 
     26 };
     27 
     28 
     29