You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

902 lines
27 KiB

9 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
  1. /*!
  2. * # Semantic UI 2.0.0 - Modal
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. ;(function ( $, window, document, undefined ) {
  12. "use strict";
  13. $.fn.modal = function(parameters) {
  14. var
  15. $allModules = $(this),
  16. $window = $(window),
  17. $document = $(document),
  18. $body = $('body'),
  19. moduleSelector = $allModules.selector || '',
  20. time = new Date().getTime(),
  21. performance = [],
  22. query = arguments[0],
  23. methodInvoked = (typeof query == 'string'),
  24. queryArguments = [].slice.call(arguments, 1),
  25. requestAnimationFrame = window.requestAnimationFrame
  26. || window.mozRequestAnimationFrame
  27. || window.webkitRequestAnimationFrame
  28. || window.msRequestAnimationFrame
  29. || function(callback) { setTimeout(callback, 0); },
  30. returnedValue
  31. ;
  32. $allModules
  33. .each(function() {
  34. var
  35. settings = ( $.isPlainObject(parameters) )
  36. ? $.extend(true, {}, $.fn.modal.settings, parameters)
  37. : $.extend({}, $.fn.modal.settings),
  38. selector = settings.selector,
  39. className = settings.className,
  40. namespace = settings.namespace,
  41. error = settings.error,
  42. eventNamespace = '.' + namespace,
  43. moduleNamespace = 'module-' + namespace,
  44. $module = $(this),
  45. $context = $(settings.context),
  46. $close = $module.find(selector.close),
  47. $allModals,
  48. $otherModals,
  49. $focusedElement,
  50. $dimmable,
  51. $dimmer,
  52. element = this,
  53. instance = $module.data(moduleNamespace),
  54. elementNamespace,
  55. id,
  56. observer,
  57. module
  58. ;
  59. module = {
  60. initialize: function() {
  61. module.verbose('Initializing dimmer', $context);
  62. module.create.id();
  63. module.create.dimmer();
  64. module.refreshModals();
  65. module.bind.events();
  66. module.observeChanges();
  67. module.instantiate();
  68. },
  69. instantiate: function() {
  70. module.verbose('Storing instance of modal');
  71. instance = module;
  72. $module
  73. .data(moduleNamespace, instance)
  74. ;
  75. },
  76. create: {
  77. dimmer: function() {
  78. var
  79. defaultSettings = {
  80. debug : settings.debug,
  81. dimmerName : 'modals',
  82. duration : {
  83. show : settings.duration,
  84. hide : settings.duration
  85. }
  86. },
  87. dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings)
  88. ;
  89. if(settings.inverted) {
  90. dimmerSettings.variation = (dimmerSettings.variation !== undefined)
  91. ? dimmerSettings.variation + ' inverted'
  92. : 'inverted'
  93. ;
  94. }
  95. if($.fn.dimmer === undefined) {
  96. module.error(error.dimmer);
  97. return;
  98. }
  99. module.debug('Creating dimmer with settings', dimmerSettings);
  100. $dimmable = $context.dimmer(dimmerSettings);
  101. if(settings.detachable) {
  102. module.verbose('Modal is detachable, moving content into dimmer');
  103. $dimmable.dimmer('add content', $module);
  104. }
  105. else {
  106. module.set.undetached();
  107. }
  108. if(settings.blurring) {
  109. $dimmable.addClass(className.blurring);
  110. }
  111. $dimmer = $dimmable.dimmer('get dimmer');
  112. },
  113. id: function() {
  114. id = (Math.random().toString(16) + '000000000').substr(2,8);
  115. elementNamespace = '.' + id;
  116. module.verbose('Creating unique id for element', id);
  117. }
  118. },
  119. destroy: function() {
  120. module.verbose('Destroying previous modal');
  121. $module
  122. .removeData(moduleNamespace)
  123. .off(eventNamespace)
  124. ;
  125. $window.off(elementNamespace);
  126. $close.off(eventNamespace);
  127. $context.dimmer('destroy');
  128. },
  129. observeChanges: function() {
  130. if('MutationObserver' in window) {
  131. observer = new MutationObserver(function(mutations) {
  132. module.debug('DOM tree modified, refreshing');
  133. module.refresh();
  134. });
  135. observer.observe(element, {
  136. childList : true,
  137. subtree : true
  138. });
  139. module.debug('Setting up mutation observer', observer);
  140. }
  141. },
  142. refresh: function() {
  143. module.remove.scrolling();
  144. module.cacheSizes();
  145. module.set.screenHeight();
  146. module.set.type();
  147. module.set.position();
  148. },
  149. refreshModals: function() {
  150. $otherModals = $module.siblings(selector.modal);
  151. $allModals = $otherModals.add($module);
  152. },
  153. attachEvents: function(selector, event) {
  154. var
  155. $toggle = $(selector)
  156. ;
  157. event = $.isFunction(module[event])
  158. ? module[event]
  159. : module.toggle
  160. ;
  161. if($toggle.length > 0) {
  162. module.debug('Attaching modal events to element', selector, event);
  163. $toggle
  164. .off(eventNamespace)
  165. .on('click' + eventNamespace, event)
  166. ;
  167. }
  168. else {
  169. module.error(error.notFound, selector);
  170. }
  171. },
  172. bind: {
  173. events: function() {
  174. module.verbose('Attaching events');
  175. $module
  176. .on('click' + eventNamespace, selector.close, module.event.close)
  177. ;
  178. $window
  179. .on('resize' + elementNamespace, module.event.resize)
  180. ;
  181. }
  182. },
  183. get: {
  184. id: function() {
  185. return (Math.random().toString(16) + '000000000').substr(2,8);
  186. }
  187. },
  188. event: {
  189. close: function() {
  190. var
  191. $element = $(this)
  192. ;
  193. module.verbose('Closing element activated');
  194. if( $element.is(selector.approve) ) {
  195. if(settings.onApprove.call(element, $element) !== false) {
  196. module.hide();
  197. }
  198. else {
  199. module.verbose('Approve callback returned false cancelling hide');
  200. }
  201. }
  202. else if( $element.is(selector.deny) ) {
  203. if(settings.onDeny.call(element, $element) !== false) {
  204. module.hide();
  205. }
  206. else {
  207. module.verbose('Deny callback returned false cancelling hide');
  208. }
  209. }
  210. else {
  211. module.hide();
  212. }
  213. },
  214. click: function(event) {
  215. var
  216. $target = $(event.target),
  217. isInModal = ($target.closest(selector.modal).length > 0),
  218. isInDOM = $.contains(document.documentElement, event.target)
  219. ;
  220. if(!isInModal && isInDOM) {
  221. module.debug('Dimmer clicked, hiding all modals');
  222. if( module.is.active() ) {
  223. module.remove.clickaway();
  224. if(settings.allowMultiple) {
  225. module.hide();
  226. }
  227. else {
  228. module.hideAll();
  229. }
  230. }
  231. }
  232. },
  233. debounce: function(method, delay) {
  234. clearTimeout(module.timer);
  235. module.timer = setTimeout(method, delay);
  236. },
  237. keyboard: function(event) {
  238. var
  239. keyCode = event.which,
  240. escapeKey = 27
  241. ;
  242. if(keyCode == escapeKey) {
  243. if(settings.closable) {
  244. module.debug('Escape key pressed hiding modal');
  245. module.hide();
  246. }
  247. else {
  248. module.debug('Escape key pressed, but closable is set to false');
  249. }
  250. event.preventDefault();
  251. }
  252. },
  253. resize: function() {
  254. if( $dimmable.dimmer('is active') ) {
  255. requestAnimationFrame(module.refresh);
  256. }
  257. }
  258. },
  259. toggle: function() {
  260. if( module.is.active() || module.is.animating() ) {
  261. module.hide();
  262. }
  263. else {
  264. module.show();
  265. }
  266. },
  267. show: function(callback) {
  268. callback = $.isFunction(callback)
  269. ? callback
  270. : function(){}
  271. ;
  272. module.refreshModals();
  273. module.showModal(callback);
  274. },
  275. hide: function(callback) {
  276. callback = $.isFunction(callback)
  277. ? callback
  278. : function(){}
  279. ;
  280. module.refreshModals();
  281. module.hideModal(callback);
  282. },
  283. showModal: function(callback) {
  284. callback = $.isFunction(callback)
  285. ? callback
  286. : function(){}
  287. ;
  288. if( module.is.animating() || !module.is.active() ) {
  289. module.showDimmer();
  290. module.cacheSizes();
  291. module.set.position();
  292. module.set.screenHeight();
  293. module.set.type();
  294. module.set.clickaway();
  295. if( !settings.allowMultiple && $otherModals.filter('.' + className.active).length > 0) {
  296. module.debug('Other modals visible, queueing show animation');
  297. module.hideOthers(module.showModal);
  298. }
  299. else {
  300. settings.onShow.call(element);
  301. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  302. module.debug('Showing modal with css animations');
  303. $module
  304. .transition({
  305. debug : settings.debug,
  306. animation : settings.transition + ' in',
  307. queue : settings.queue,
  308. duration : settings.duration,
  309. useFailSafe : true,
  310. onComplete : function() {
  311. settings.onVisible.apply(element);
  312. module.add.keyboardShortcuts();
  313. module.save.focus();
  314. module.set.active();
  315. module.set.autofocus();
  316. callback();
  317. }
  318. })
  319. ;
  320. }
  321. else {
  322. module.debug('Showing modal with javascript');
  323. $module
  324. .fadeIn(settings.duration, settings.easing, function() {
  325. settings.onVisible.apply(element);
  326. module.add.keyboardShortcuts();
  327. module.save.focus();
  328. module.set.active();
  329. callback();
  330. })
  331. ;
  332. }
  333. }
  334. }
  335. else {
  336. module.debug('Modal is already visible');
  337. }
  338. },
  339. hideModal: function(callback, keepDimmed) {
  340. callback = $.isFunction(callback)
  341. ? callback
  342. : function(){}
  343. ;
  344. module.debug('Hiding modal');
  345. settings.onHide.call(element);
  346. if( module.is.animating() || module.is.active() ) {
  347. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  348. module.remove.active();
  349. $module
  350. .transition({
  351. debug : settings.debug,
  352. animation : settings.transition + ' out',
  353. queue : settings.queue,
  354. duration : settings.duration,
  355. useFailSafe : true,
  356. onStart : function() {
  357. if(!module.othersActive() && !keepDimmed) {
  358. module.hideDimmer();
  359. }
  360. module.remove.keyboardShortcuts();
  361. },
  362. onComplete : function() {
  363. settings.onHidden.call(element);
  364. module.restore.focus();
  365. callback();
  366. }
  367. })
  368. ;
  369. }
  370. else {
  371. module.remove.active();
  372. if( !module.othersActive() ) {
  373. module.hideDimmer();
  374. }
  375. module.remove.keyboardShortcuts();
  376. $module
  377. .fadeOut(settings.duration, settings.easing, function() {
  378. settings.onHidden.call(element);
  379. module.restore.focus();
  380. callback();
  381. })
  382. ;
  383. }
  384. }
  385. },
  386. showDimmer: function() {
  387. if($dimmable.dimmer('is animating') || !$dimmable.dimmer('is active') ) {
  388. module.debug('Showing dimmer');
  389. $dimmable.dimmer('show');
  390. }
  391. else {
  392. module.debug('Dimmer already visible');
  393. }
  394. },
  395. hideDimmer: function() {
  396. if( $dimmable.dimmer('is animating') || ($dimmable.dimmer('is active')) ) {
  397. $dimmable.dimmer('hide', function() {
  398. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  399. module.remove.clickaway();
  400. module.remove.screenHeight();
  401. }
  402. });
  403. }
  404. else {
  405. module.debug('Dimmer is not visible cannot hide');
  406. return;
  407. }
  408. },
  409. hideAll: function(callback) {
  410. var
  411. $visibleModals = $allModals.filter(':visible')
  412. ;
  413. callback = $.isFunction(callback)
  414. ? callback
  415. : function(){}
  416. ;
  417. if( $visibleModals.length > 0 ) {
  418. module.debug('Hiding all visible modals');
  419. module.hideDimmer();
  420. $visibleModals
  421. .modal('hide modal', callback)
  422. ;
  423. }
  424. },
  425. hideOthers: function(callback) {
  426. var
  427. $visibleModals = $otherModals.filter(':visible')
  428. ;
  429. callback = $.isFunction(callback)
  430. ? callback
  431. : function(){}
  432. ;
  433. if( $visibleModals.length > 0 ) {
  434. module.debug('Hiding other modals', $otherModals);
  435. $visibleModals
  436. .modal('hide modal', callback, true)
  437. ;
  438. }
  439. },
  440. othersActive: function() {
  441. return ($otherModals.filter('.' + className.active + ', .' + className.animating).length > 0);
  442. },
  443. add: {
  444. keyboardShortcuts: function() {
  445. module.verbose('Adding keyboard shortcuts');
  446. $document
  447. .on('keyup' + eventNamespace, module.event.keyboard)
  448. ;
  449. }
  450. },
  451. save: {
  452. focus: function() {
  453. $focusedElement = $(document.activeElement).blur();
  454. }
  455. },
  456. restore: {
  457. focus: function() {
  458. if($focusedElement && $focusedElement.length > 0) {
  459. $focusedElement.focus();
  460. }
  461. }
  462. },
  463. remove: {
  464. active: function() {
  465. $module.removeClass(className.active);
  466. },
  467. clickaway: function() {
  468. if(settings.closable) {
  469. $dimmer
  470. .off('click' + elementNamespace)
  471. ;
  472. }
  473. },
  474. screenHeight: function() {
  475. if(module.cache.height > module.cache.pageHeight) {
  476. module.debug('Removing page height');
  477. $body
  478. .css('height', '')
  479. ;
  480. }
  481. },
  482. keyboardShortcuts: function() {
  483. module.verbose('Removing keyboard shortcuts');
  484. $document
  485. .off('keyup' + eventNamespace)
  486. ;
  487. },
  488. scrolling: function() {
  489. $dimmable.removeClass(className.scrolling);
  490. $module.removeClass(className.scrolling);
  491. }
  492. },
  493. cacheSizes: function() {
  494. var
  495. modalHeight = $module.outerHeight()
  496. ;
  497. if(module.cache === undefined || modalHeight !== 0) {
  498. module.cache = {
  499. pageHeight : $(document).outerHeight(),
  500. height : modalHeight + settings.offset,
  501. contextHeight : (settings.context == 'body')
  502. ? $(window).height()
  503. : $dimmable.height()
  504. };
  505. }
  506. module.debug('Caching modal and container sizes', module.cache);
  507. },
  508. can: {
  509. fit: function() {
  510. return ( ( module.cache.height + (settings.padding * 2) ) < module.cache.contextHeight);
  511. }
  512. },
  513. is: {
  514. active: function() {
  515. return $module.hasClass(className.active);
  516. },
  517. animating: function() {
  518. return $module.transition('is supported')
  519. ? $module.transition('is animating')
  520. : $module.is(':visible')
  521. ;
  522. },
  523. scrolling: function() {
  524. return $dimmable.hasClass(className.scrolling);
  525. },
  526. modernBrowser: function() {
  527. // appName for IE11 reports 'Netscape' can no longer use
  528. return !(window.ActiveXObject || "ActiveXObject" in window);
  529. }
  530. },
  531. set: {
  532. autofocus: function() {
  533. if(settings.autofocus) {
  534. var
  535. $inputs = $module.find(':input:visible'),
  536. $autofocus = $inputs.filter('[autofocus]'),
  537. $input = ($autofocus.length > 0)
  538. ? $autofocus
  539. : $inputs
  540. ;
  541. $input.first().focus();
  542. }
  543. },
  544. clickaway: function() {
  545. if(settings.closable) {
  546. $dimmer
  547. .on('click' + elementNamespace, module.event.click)
  548. ;
  549. }
  550. },
  551. screenHeight: function() {
  552. if( module.can.fit() ) {
  553. $body.css('height', '');
  554. }
  555. else {
  556. module.debug('Modal is taller than page content, resizing page height');
  557. $body
  558. .css('height', module.cache.height + (settings.padding * 2) )
  559. ;
  560. }
  561. },
  562. active: function() {
  563. $module.addClass(className.active);
  564. },
  565. scrolling: function() {
  566. $dimmable.addClass(className.scrolling);
  567. $module.addClass(className.scrolling);
  568. },
  569. type: function() {
  570. if(module.can.fit()) {
  571. module.verbose('Modal fits on screen');
  572. if(!module.othersActive()) {
  573. module.remove.scrolling();
  574. }
  575. }
  576. else {
  577. module.verbose('Modal cannot fit on screen setting to scrolling');
  578. module.set.scrolling();
  579. }
  580. },
  581. position: function() {
  582. module.verbose('Centering modal on page', module.cache);
  583. if(module.can.fit()) {
  584. $module
  585. .css({
  586. top: '',
  587. marginTop: -(module.cache.height / 2)
  588. })
  589. ;
  590. }
  591. else {
  592. $module
  593. .css({
  594. marginTop : '',
  595. top : $document.scrollTop()
  596. })
  597. ;
  598. }
  599. },
  600. undetached: function() {
  601. $dimmable.addClass(className.undetached);
  602. }
  603. },
  604. setting: function(name, value) {
  605. module.debug('Changing setting', name, value);
  606. if( $.isPlainObject(name) ) {
  607. $.extend(true, settings, name);
  608. }
  609. else if(value !== undefined) {
  610. settings[name] = value;
  611. }
  612. else {
  613. return settings[name];
  614. }
  615. },
  616. internal: function(name, value) {
  617. if( $.isPlainObject(name) ) {
  618. $.extend(true, module, name);
  619. }
  620. else if(value !== undefined) {
  621. module[name] = value;
  622. }
  623. else {
  624. return module[name];
  625. }
  626. },
  627. debug: function() {
  628. if(settings.debug) {
  629. if(settings.performance) {
  630. module.performance.log(arguments);
  631. }
  632. else {
  633. module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
  634. module.debug.apply(console, arguments);
  635. }
  636. }
  637. },
  638. verbose: function() {
  639. if(settings.verbose && settings.debug) {
  640. if(settings.performance) {
  641. module.performance.log(arguments);
  642. }
  643. else {
  644. module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
  645. module.verbose.apply(console, arguments);
  646. }
  647. }
  648. },
  649. error: function() {
  650. module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
  651. module.error.apply(console, arguments);
  652. },
  653. performance: {
  654. log: function(message) {
  655. var
  656. currentTime,
  657. executionTime,
  658. previousTime
  659. ;
  660. if(settings.performance) {
  661. currentTime = new Date().getTime();
  662. previousTime = time || currentTime;
  663. executionTime = currentTime - previousTime;
  664. time = currentTime;
  665. performance.push({
  666. 'Name' : message[0],
  667. 'Arguments' : [].slice.call(message, 1) || '',
  668. 'Element' : element,
  669. 'Execution Time' : executionTime
  670. });
  671. }
  672. clearTimeout(module.performance.timer);
  673. module.performance.timer = setTimeout(module.performance.display, 500);
  674. },
  675. display: function() {
  676. var
  677. title = settings.name + ':',
  678. totalTime = 0
  679. ;
  680. time = false;
  681. clearTimeout(module.performance.timer);
  682. $.each(performance, function(index, data) {
  683. totalTime += data['Execution Time'];
  684. });
  685. title += ' ' + totalTime + 'ms';
  686. if(moduleSelector) {
  687. title += ' \'' + moduleSelector + '\'';
  688. }
  689. if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
  690. console.groupCollapsed(title);
  691. if(console.table) {
  692. console.table(performance);
  693. }
  694. else {
  695. $.each(performance, function(index, data) {
  696. console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
  697. });
  698. }
  699. console.groupEnd();
  700. }
  701. performance = [];
  702. }
  703. },
  704. invoke: function(query, passedArguments, context) {
  705. var
  706. object = instance,
  707. maxDepth,
  708. found,
  709. response
  710. ;
  711. passedArguments = passedArguments || queryArguments;
  712. context = element || context;
  713. if(typeof query == 'string' && object !== undefined) {
  714. query = query.split(/[\. ]/);
  715. maxDepth = query.length - 1;
  716. $.each(query, function(depth, value) {
  717. var camelCaseValue = (depth != maxDepth)
  718. ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
  719. : query
  720. ;
  721. if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
  722. object = object[camelCaseValue];
  723. }
  724. else if( object[camelCaseValue] !== undefined ) {
  725. found = object[camelCaseValue];
  726. return false;
  727. }
  728. else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
  729. object = object[value];
  730. }
  731. else if( object[value] !== undefined ) {
  732. found = object[value];
  733. return false;
  734. }
  735. else {
  736. return false;
  737. }
  738. });
  739. }
  740. if ( $.isFunction( found ) ) {
  741. response = found.apply(context, passedArguments);
  742. }
  743. else if(found !== undefined) {
  744. response = found;
  745. }
  746. if($.isArray(returnedValue)) {
  747. returnedValue.push(response);
  748. }
  749. else if(returnedValue !== undefined) {
  750. returnedValue = [returnedValue, response];
  751. }
  752. else if(response !== undefined) {
  753. returnedValue = response;
  754. }
  755. return found;
  756. }
  757. };
  758. if(methodInvoked) {
  759. if(instance === undefined) {
  760. module.initialize();
  761. }
  762. module.invoke(query);
  763. }
  764. else {
  765. if(instance !== undefined) {
  766. instance.invoke('destroy');
  767. }
  768. module.initialize();
  769. }
  770. })
  771. ;
  772. return (returnedValue !== undefined)
  773. ? returnedValue
  774. : this
  775. ;
  776. };
  777. $.fn.modal.settings = {
  778. name : 'Modal',
  779. namespace : 'modal',
  780. debug : false,
  781. verbose : false,
  782. performance : true,
  783. allowMultiple : false,
  784. detachable : true,
  785. closable : true,
  786. autofocus : true,
  787. inverted : false,
  788. blurring : false,
  789. dimmerSettings : {
  790. closable : false,
  791. useCSS : true
  792. },
  793. context : 'body',
  794. queue : false,
  795. duration : 500,
  796. easing : 'easeOutExpo',
  797. offset : 0,
  798. transition : 'scale',
  799. // padding with edge of page
  800. padding : 50,
  801. // called before show animation
  802. onShow : function(){},
  803. // called after show animation
  804. onVisible : function(){},
  805. // called before hide animation
  806. onHide : function(){},
  807. // called after hide animation
  808. onHidden : function(){},
  809. // called after approve selector match
  810. onApprove : function(){ return true; },
  811. // called after deny selector match
  812. onDeny : function(){ return true; },
  813. selector : {
  814. close : '.close, .actions .button',
  815. approve : '.actions .positive, .actions .approve, .actions .ok',
  816. deny : '.actions .negative, .actions .deny, .actions .cancel',
  817. modal : '.ui.modal'
  818. },
  819. error : {
  820. dimmer : 'UI Dimmer, a required component is not included in this page',
  821. method : 'The method you called is not defined.',
  822. notFound : 'The element you specified could not be found'
  823. },
  824. className : {
  825. active : 'active',
  826. animating : 'animating',
  827. blurring : 'blurring',
  828. scrolling : 'scrolling',
  829. undetached : 'undetached'
  830. }
  831. };
  832. })( jQuery, window , document );