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.

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