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.

899 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. module.verbose('Closing element pressed');
  191. if( $(this).is(selector.approve) ) {
  192. if(settings.onApprove.call(element) !== false) {
  193. module.hide();
  194. }
  195. else {
  196. module.verbose('Approve callback returned false cancelling hide');
  197. }
  198. }
  199. else if( $(this).is(selector.deny) ) {
  200. if(settings.onDeny.call(element) !== false) {
  201. module.hide();
  202. }
  203. else {
  204. module.verbose('Deny callback returned false cancelling hide');
  205. }
  206. }
  207. else {
  208. module.hide();
  209. }
  210. },
  211. click: function(event) {
  212. var
  213. $target = $(event.target),
  214. isInModal = ($target.closest(selector.modal).length > 0),
  215. isInDOM = $.contains(document.documentElement, event.target)
  216. ;
  217. if(!isInModal && isInDOM) {
  218. module.debug('Dimmer clicked, hiding all modals');
  219. if( module.is.active() ) {
  220. module.remove.clickaway();
  221. if(settings.allowMultiple) {
  222. module.hide();
  223. }
  224. else {
  225. module.hideAll();
  226. }
  227. }
  228. }
  229. },
  230. debounce: function(method, delay) {
  231. clearTimeout(module.timer);
  232. module.timer = setTimeout(method, delay);
  233. },
  234. keyboard: function(event) {
  235. var
  236. keyCode = event.which,
  237. escapeKey = 27
  238. ;
  239. if(keyCode == escapeKey) {
  240. if(settings.closable) {
  241. module.debug('Escape key pressed hiding modal');
  242. module.hide();
  243. }
  244. else {
  245. module.debug('Escape key pressed, but closable is set to false');
  246. }
  247. event.preventDefault();
  248. }
  249. },
  250. resize: function() {
  251. if( $dimmable.dimmer('is active') ) {
  252. requestAnimationFrame(module.refresh);
  253. }
  254. }
  255. },
  256. toggle: function() {
  257. if( module.is.active() || module.is.animating() ) {
  258. module.hide();
  259. }
  260. else {
  261. module.show();
  262. }
  263. },
  264. show: function(callback) {
  265. callback = $.isFunction(callback)
  266. ? callback
  267. : function(){}
  268. ;
  269. module.refreshModals();
  270. module.showModal(callback);
  271. },
  272. hide: function(callback) {
  273. callback = $.isFunction(callback)
  274. ? callback
  275. : function(){}
  276. ;
  277. module.refreshModals();
  278. module.hideModal(callback);
  279. },
  280. showModal: function(callback) {
  281. callback = $.isFunction(callback)
  282. ? callback
  283. : function(){}
  284. ;
  285. if( module.is.animating() || !module.is.active() ) {
  286. module.showDimmer();
  287. module.cacheSizes();
  288. module.set.position();
  289. module.set.screenHeight();
  290. module.set.type();
  291. module.set.clickaway();
  292. if( !settings.allowMultiple && $otherModals.filter('.' + className.active).length > 0) {
  293. module.debug('Other modals visible, queueing show animation');
  294. module.hideOthers(module.showModal);
  295. }
  296. else {
  297. settings.onShow.call(element);
  298. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  299. module.debug('Showing modal with css animations');
  300. $module
  301. .transition({
  302. debug : settings.debug,
  303. animation : settings.transition + ' in',
  304. queue : settings.queue,
  305. duration : settings.duration,
  306. useFailSafe : true,
  307. onComplete : function() {
  308. settings.onVisible.apply(element);
  309. module.add.keyboardShortcuts();
  310. module.save.focus();
  311. module.set.active();
  312. module.set.autofocus();
  313. callback();
  314. }
  315. })
  316. ;
  317. }
  318. else {
  319. module.debug('Showing modal with javascript');
  320. $module
  321. .fadeIn(settings.duration, settings.easing, function() {
  322. settings.onVisible.apply(element);
  323. module.add.keyboardShortcuts();
  324. module.save.focus();
  325. module.set.active();
  326. callback();
  327. })
  328. ;
  329. }
  330. }
  331. }
  332. else {
  333. module.debug('Modal is already visible');
  334. }
  335. },
  336. hideModal: function(callback, keepDimmed) {
  337. callback = $.isFunction(callback)
  338. ? callback
  339. : function(){}
  340. ;
  341. module.debug('Hiding modal');
  342. settings.onHide.call(element);
  343. if( module.is.animating() || module.is.active() ) {
  344. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  345. module.remove.active();
  346. $module
  347. .transition({
  348. debug : settings.debug,
  349. animation : settings.transition + ' out',
  350. queue : settings.queue,
  351. duration : settings.duration,
  352. useFailSafe : true,
  353. onStart : function() {
  354. if(!module.othersActive() && !keepDimmed) {
  355. module.hideDimmer();
  356. }
  357. module.remove.keyboardShortcuts();
  358. },
  359. onComplete : function() {
  360. settings.onHidden.call(element);
  361. module.restore.focus();
  362. callback();
  363. }
  364. })
  365. ;
  366. }
  367. else {
  368. module.remove.active();
  369. if( !module.othersActive() ) {
  370. module.hideDimmer();
  371. }
  372. module.remove.keyboardShortcuts();
  373. $module
  374. .fadeOut(settings.duration, settings.easing, function() {
  375. settings.onHidden.call(element);
  376. module.restore.focus();
  377. callback();
  378. })
  379. ;
  380. }
  381. }
  382. },
  383. showDimmer: function() {
  384. if($dimmable.dimmer('is animating') || !$dimmable.dimmer('is active') ) {
  385. module.debug('Showing dimmer');
  386. $dimmable.dimmer('show');
  387. }
  388. else {
  389. module.debug('Dimmer already visible');
  390. }
  391. },
  392. hideDimmer: function() {
  393. if( $dimmable.dimmer('is animating') || ($dimmable.dimmer('is active')) ) {
  394. $dimmable.dimmer('hide', function() {
  395. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  396. module.remove.clickaway();
  397. module.remove.screenHeight();
  398. }
  399. });
  400. }
  401. else {
  402. module.debug('Dimmer is not visible cannot hide');
  403. return;
  404. }
  405. },
  406. hideAll: function(callback) {
  407. var
  408. $visibleModals = $allModals.filter(':visible')
  409. ;
  410. callback = $.isFunction(callback)
  411. ? callback
  412. : function(){}
  413. ;
  414. if( $visibleModals.length > 0 ) {
  415. module.debug('Hiding all visible modals');
  416. module.hideDimmer();
  417. $visibleModals
  418. .modal('hide modal', callback)
  419. ;
  420. }
  421. },
  422. hideOthers: function(callback) {
  423. var
  424. $visibleModals = $otherModals.filter(':visible')
  425. ;
  426. callback = $.isFunction(callback)
  427. ? callback
  428. : function(){}
  429. ;
  430. if( $visibleModals.length > 0 ) {
  431. module.debug('Hiding other modals', $otherModals);
  432. $visibleModals
  433. .modal('hide modal', callback, true)
  434. ;
  435. }
  436. },
  437. othersActive: function() {
  438. return ($otherModals.filter('.' + className.active + ', .' + className.animating).length > 0);
  439. },
  440. add: {
  441. keyboardShortcuts: function() {
  442. module.verbose('Adding keyboard shortcuts');
  443. $document
  444. .on('keyup' + eventNamespace, module.event.keyboard)
  445. ;
  446. }
  447. },
  448. save: {
  449. focus: function() {
  450. $focusedElement = $(document.activeElement).blur();
  451. }
  452. },
  453. restore: {
  454. focus: function() {
  455. if($focusedElement && $focusedElement.length > 0) {
  456. $focusedElement.focus();
  457. }
  458. }
  459. },
  460. remove: {
  461. active: function() {
  462. $module.removeClass(className.active);
  463. },
  464. clickaway: function() {
  465. if(settings.closable) {
  466. $dimmer
  467. .off('click' + elementNamespace)
  468. ;
  469. }
  470. },
  471. screenHeight: function() {
  472. if(module.cache.height > module.cache.pageHeight) {
  473. module.debug('Removing page height');
  474. $body
  475. .css('height', '')
  476. ;
  477. }
  478. },
  479. keyboardShortcuts: function() {
  480. module.verbose('Removing keyboard shortcuts');
  481. $document
  482. .off('keyup' + eventNamespace)
  483. ;
  484. },
  485. scrolling: function() {
  486. $dimmable.removeClass(className.scrolling);
  487. $module.removeClass(className.scrolling);
  488. }
  489. },
  490. cacheSizes: function() {
  491. var
  492. modalHeight = $module.outerHeight()
  493. ;
  494. if(module.cache === undefined || modalHeight !== 0) {
  495. module.cache = {
  496. pageHeight : $(document).outerHeight(),
  497. height : modalHeight + settings.offset,
  498. contextHeight : (settings.context == 'body')
  499. ? $(window).height()
  500. : $dimmable.height()
  501. };
  502. }
  503. module.debug('Caching modal and container sizes', module.cache);
  504. },
  505. can: {
  506. fit: function() {
  507. return ( ( module.cache.height + (settings.padding * 2) ) < module.cache.contextHeight);
  508. }
  509. },
  510. is: {
  511. active: function() {
  512. return $module.hasClass(className.active);
  513. },
  514. animating: function() {
  515. return $module.transition('is supported')
  516. ? $module.transition('is animating')
  517. : $module.is(':visible')
  518. ;
  519. },
  520. scrolling: function() {
  521. return $dimmable.hasClass(className.scrolling);
  522. },
  523. modernBrowser: function() {
  524. // appName for IE11 reports 'Netscape' can no longer use
  525. return !(window.ActiveXObject || "ActiveXObject" in window);
  526. }
  527. },
  528. set: {
  529. autofocus: function() {
  530. if(settings.autofocus) {
  531. var
  532. $inputs = $module.find(':input:visible'),
  533. $autofocus = $inputs.filter('[autofocus]'),
  534. $input = ($autofocus.length > 0)
  535. ? $autofocus
  536. : $inputs
  537. ;
  538. $input.first().focus();
  539. }
  540. },
  541. clickaway: function() {
  542. if(settings.closable) {
  543. $dimmer
  544. .on('click' + elementNamespace, module.event.click)
  545. ;
  546. }
  547. },
  548. screenHeight: function() {
  549. if( module.can.fit() ) {
  550. $body.css('height', '');
  551. }
  552. else {
  553. module.debug('Modal is taller than page content, resizing page height');
  554. $body
  555. .css('height', module.cache.height + (settings.padding * 2) )
  556. ;
  557. }
  558. },
  559. active: function() {
  560. $module.addClass(className.active);
  561. },
  562. scrolling: function() {
  563. $dimmable.addClass(className.scrolling);
  564. $module.addClass(className.scrolling);
  565. },
  566. type: function() {
  567. if(module.can.fit()) {
  568. module.verbose('Modal fits on screen');
  569. if(!module.othersActive()) {
  570. module.remove.scrolling();
  571. }
  572. }
  573. else {
  574. module.verbose('Modal cannot fit on screen setting to scrolling');
  575. module.set.scrolling();
  576. }
  577. },
  578. position: function() {
  579. module.verbose('Centering modal on page', module.cache);
  580. if(module.can.fit()) {
  581. $module
  582. .css({
  583. top: '',
  584. marginTop: -(module.cache.height / 2)
  585. })
  586. ;
  587. }
  588. else {
  589. $module
  590. .css({
  591. marginTop : '',
  592. top : $document.scrollTop()
  593. })
  594. ;
  595. }
  596. },
  597. undetached: function() {
  598. $dimmable.addClass(className.undetached);
  599. }
  600. },
  601. setting: function(name, value) {
  602. module.debug('Changing setting', name, value);
  603. if( $.isPlainObject(name) ) {
  604. $.extend(true, settings, name);
  605. }
  606. else if(value !== undefined) {
  607. settings[name] = value;
  608. }
  609. else {
  610. return settings[name];
  611. }
  612. },
  613. internal: function(name, value) {
  614. if( $.isPlainObject(name) ) {
  615. $.extend(true, module, name);
  616. }
  617. else if(value !== undefined) {
  618. module[name] = value;
  619. }
  620. else {
  621. return module[name];
  622. }
  623. },
  624. debug: function() {
  625. if(settings.debug) {
  626. if(settings.performance) {
  627. module.performance.log(arguments);
  628. }
  629. else {
  630. module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
  631. module.debug.apply(console, arguments);
  632. }
  633. }
  634. },
  635. verbose: function() {
  636. if(settings.verbose && settings.debug) {
  637. if(settings.performance) {
  638. module.performance.log(arguments);
  639. }
  640. else {
  641. module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
  642. module.verbose.apply(console, arguments);
  643. }
  644. }
  645. },
  646. error: function() {
  647. module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
  648. module.error.apply(console, arguments);
  649. },
  650. performance: {
  651. log: function(message) {
  652. var
  653. currentTime,
  654. executionTime,
  655. previousTime
  656. ;
  657. if(settings.performance) {
  658. currentTime = new Date().getTime();
  659. previousTime = time || currentTime;
  660. executionTime = currentTime - previousTime;
  661. time = currentTime;
  662. performance.push({
  663. 'Name' : message[0],
  664. 'Arguments' : [].slice.call(message, 1) || '',
  665. 'Element' : element,
  666. 'Execution Time' : executionTime
  667. });
  668. }
  669. clearTimeout(module.performance.timer);
  670. module.performance.timer = setTimeout(module.performance.display, 500);
  671. },
  672. display: function() {
  673. var
  674. title = settings.name + ':',
  675. totalTime = 0
  676. ;
  677. time = false;
  678. clearTimeout(module.performance.timer);
  679. $.each(performance, function(index, data) {
  680. totalTime += data['Execution Time'];
  681. });
  682. title += ' ' + totalTime + 'ms';
  683. if(moduleSelector) {
  684. title += ' \'' + moduleSelector + '\'';
  685. }
  686. if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
  687. console.groupCollapsed(title);
  688. if(console.table) {
  689. console.table(performance);
  690. }
  691. else {
  692. $.each(performance, function(index, data) {
  693. console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
  694. });
  695. }
  696. console.groupEnd();
  697. }
  698. performance = [];
  699. }
  700. },
  701. invoke: function(query, passedArguments, context) {
  702. var
  703. object = instance,
  704. maxDepth,
  705. found,
  706. response
  707. ;
  708. passedArguments = passedArguments || queryArguments;
  709. context = element || context;
  710. if(typeof query == 'string' && object !== undefined) {
  711. query = query.split(/[\. ]/);
  712. maxDepth = query.length - 1;
  713. $.each(query, function(depth, value) {
  714. var camelCaseValue = (depth != maxDepth)
  715. ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
  716. : query
  717. ;
  718. if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
  719. object = object[camelCaseValue];
  720. }
  721. else if( object[camelCaseValue] !== undefined ) {
  722. found = object[camelCaseValue];
  723. return false;
  724. }
  725. else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
  726. object = object[value];
  727. }
  728. else if( object[value] !== undefined ) {
  729. found = object[value];
  730. return false;
  731. }
  732. else {
  733. return false;
  734. }
  735. });
  736. }
  737. if ( $.isFunction( found ) ) {
  738. response = found.apply(context, passedArguments);
  739. }
  740. else if(found !== undefined) {
  741. response = found;
  742. }
  743. if($.isArray(returnedValue)) {
  744. returnedValue.push(response);
  745. }
  746. else if(returnedValue !== undefined) {
  747. returnedValue = [returnedValue, response];
  748. }
  749. else if(response !== undefined) {
  750. returnedValue = response;
  751. }
  752. return found;
  753. }
  754. };
  755. if(methodInvoked) {
  756. if(instance === undefined) {
  757. module.initialize();
  758. }
  759. module.invoke(query);
  760. }
  761. else {
  762. if(instance !== undefined) {
  763. instance.invoke('destroy');
  764. }
  765. module.initialize();
  766. }
  767. })
  768. ;
  769. return (returnedValue !== undefined)
  770. ? returnedValue
  771. : this
  772. ;
  773. };
  774. $.fn.modal.settings = {
  775. name : 'Modal',
  776. namespace : 'modal',
  777. debug : false,
  778. verbose : false,
  779. performance : true,
  780. allowMultiple : false,
  781. detachable : true,
  782. closable : true,
  783. autofocus : true,
  784. inverted : false,
  785. blurring : false,
  786. dimmerSettings : {
  787. closable : false,
  788. useCSS : true
  789. },
  790. context : 'body',
  791. queue : false,
  792. duration : 500,
  793. easing : 'easeOutExpo',
  794. offset : 0,
  795. transition : 'scale',
  796. // padding with edge of page
  797. padding : 50,
  798. // called before show animation
  799. onShow : function(){},
  800. // called after show animation
  801. onVisible : function(){},
  802. // called before hide animation
  803. onHide : function(){},
  804. // called after hide animation
  805. onHidden : function(){},
  806. // called after approve selector match
  807. onApprove : function(){ return true; },
  808. // called after deny selector match
  809. onDeny : function(){ return true; },
  810. selector : {
  811. close : '.close, .actions .button',
  812. approve : '.actions .positive, .actions .approve, .actions .ok',
  813. deny : '.actions .negative, .actions .deny, .actions .cancel',
  814. modal : '.ui.modal'
  815. },
  816. error : {
  817. dimmer : 'UI Dimmer, a required component is not included in this page',
  818. method : 'The method you called is not defined.',
  819. notFound : 'The element you specified could not be found'
  820. },
  821. className : {
  822. active : 'active',
  823. animating : 'animating',
  824. blurring : 'blurring',
  825. scrolling : 'scrolling',
  826. undetached : 'undetached'
  827. }
  828. };
  829. })( jQuery, window , document );