main.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996
  1. (function ($) {
  2. "use strict";
  3. var qayimaApp = {
  4. /* ---------------------------------------------
  5. ## Content Loading
  6. --------------------------------------------- */
  7. /* ---------------------------------------------
  8. ## Scroll top
  9. --------------------------------------------- */
  10. scroll_top: function () {
  11. $("body").append("<a href='#top' id='scroll-top' class='topbutton btn-hide'><span class='fa fa-angle-double-up'></span></a>");
  12. var $scrolltop = $('#scroll-top');
  13. $(window).on('scroll', function () {
  14. if ($(this).scrollTop() > $(this).height()) {
  15. $scrolltop
  16. .addClass('btn-show')
  17. .removeClass('btn-hide');
  18. } else {
  19. $scrolltop
  20. .addClass('btn-hide')
  21. .removeClass('btn-show');
  22. }
  23. });
  24. $("a[href='#top']").on('click', function () {
  25. $("html, body").animate({
  26. scrollTop: 0
  27. }, "normal");
  28. return false;
  29. });
  30. },
  31. /* ---------------------------------------------
  32. ## Menu Script
  33. --------------------------------------------- */
  34. menu_script: function() {
  35. if($('.mainmenu').find('li > a').siblings('.sub-menu')){
  36. $('.mainmenu li > .sub-menu').siblings('a').append("<span class='menu-arrow fas fa-sort-down'></span>");
  37. }
  38. var $submenu = $('.mainmenu').find('li').has('.sub-menu');
  39. $submenu.prepend("<span class='menu-click'><i class='menu-arrow icon-next1'></i></span>");
  40. var $mobileSubMenuOpen = $(".menu-click");
  41. $mobileSubMenuOpen.each(function() {
  42. var $self = $(this);
  43. $self.on("click", function(e) {
  44. e.stopImmediatePropagation();
  45. $self.siblings(".sub-menu").slideToggle("slow");
  46. $self.children(".menu-arrow").toggleClass("menu-extend");
  47. $(".site-header").toggleClass("sidemenu-active");
  48. });
  49. });
  50. //dashborad Menu
  51. $('.dashboard-menu-area > .btn-close').on('click', function () {
  52. $('.dashboard-menu-area').toggleClass('active');
  53. });
  54. //hamburger Menu
  55. if ($('.hamburger-menus').length) {
  56. var $hamburger_link = $('.hamburger-menus');
  57. $hamburger_link.on('click', function(e) {
  58. e.preventDefault();
  59. $(this).toggleClass('click-menu');
  60. $(this).next().toggleClass('menuopen');
  61. });
  62. var $overlayClose = $('.overlaybg');
  63. $overlayClose.on('click', function(e) {
  64. e.preventDefault();
  65. $(this).parent().removeClass('menuopen');
  66. $(this).parent().siblings('.hamburger-menus').removeClass('click-menu');
  67. });
  68. var el = document.querySelector('.site-navigation .navigation');
  69. if(el.length) {
  70. SimpleScrollbar.initEl(el);
  71. }
  72. var menuelem = $('.hamburger-content .menu-block');
  73. var delay_count = 0;
  74. menuelem.find('ul.mainmenu > li').each(function(){
  75. $(this).css('transition-delay', (delay_count * 200) + 'ms');
  76. delay_count++;
  77. });
  78. }
  79. /*-----------------------------------------------------------------
  80. Hamburger Menus Two
  81. -------------------------------------------------------------------*/
  82. $('.site-header.default-header-style .header-navigation-right-area .user-registration-area').clone().appendTo('.site-header.default-header-style .mobile-element-meta .mobile-user-registration');
  83. $('.site-header.header-style-one .header-navigation-right .user-registration-area').clone().appendTo('.site-header.header-style-one .mobile-element-meta .mobile-user-registration');
  84. //Todo Details Menu
  85. if ($('.todo-details-menu .todo-menu').length) {
  86. $('.todo-details-menu .todo-menu').onePageNav({
  87. currentClass: 'current',
  88. changeHash: true,
  89. scrollSpeed: 750,
  90. scrollThreshold: 0.5
  91. });
  92. }
  93. },
  94. /*-------------------------------------------
  95. ## Sticky Header
  96. --------------------------------------------- */
  97. sticky_header: function() {
  98. if ($('#sticky-header').length ) {
  99. // var stickyMenu = $('.site-header').clone().appendTo('#sticky-header');
  100. $(window).on('scroll', function() {
  101. var w = $(window).width();
  102. if (w > 1199) {
  103. if ($(this).scrollTop() > 350) {
  104. $('#sticky-header').slideDown(500);
  105. } else {
  106. $('#sticky-header').slideUp(500);
  107. }
  108. }
  109. });
  110. }
  111. if ($('.site-header.header-style-two').length ) {
  112. $(window).on('scroll', function() {
  113. if ($(this).scrollTop() > 1) {
  114. $('.site-header.header-style-two').addClass('active');
  115. }else {
  116. $('.site-header.header-style-two').removeClass('active');
  117. }
  118. });
  119. }
  120. },
  121. /* ---------------------------------------------
  122. ## Search
  123. --------------------------------------------- */
  124. search: function () {
  125. $('.search-wrap .search-btn').on('click', function(){
  126. if($(this).siblings('.search-form').hasClass('active')){
  127. $(this).siblings('.search-form').removeClass('active').slideUp();
  128. $(this).removeClass('active');
  129. }
  130. else{
  131. $(this).siblings('.search-form').removeClass('active').slideUp();
  132. $(this).siblings('.search-form').removeClass('active');
  133. $(this).addClass('active');
  134. $(this).siblings('.search-form').addClass('active').slideDown();
  135. }
  136. });
  137. },
  138. /* ---------------------------------------------
  139. ## Register User
  140. --------------------------------------------- */
  141. register_user: function() {
  142. $('.btn-register-now').on('click', function () {
  143. $('.user-signin-area').addClass('hidden');
  144. $('.user-signup-area').addClass('show');
  145. });
  146. $('.user-signin-area .btn-password').on('click', function () {
  147. $('.form-content-signin').addClass('hidden');
  148. $('.form-content-password').addClass('show');
  149. });
  150. $('.user-signin-area .btn-back').on('click', function () {
  151. $('.form-content-signin').removeClass('hidden');
  152. $('.form-content-password').removeClass('show');
  153. });
  154. $('.user-signup-area .form-btn-group .btn-signin').on('click', function () {
  155. $('.user-signin-area').removeClass('hidden');
  156. $('.user-signup-area').removeClass('show');
  157. $('.user-signin-area').addClass('show');
  158. $('.user-signup-area').addClass('hidden');
  159. });
  160. },
  161. /* ---------------------------------------------
  162. ## Count Down
  163. --------------------------------------------- */
  164. count_down: function() {
  165. if ($('#countdown').length) {
  166. $('#countdown').syotimer({
  167. year: 2021,
  168. month: 6,
  169. day: 9,
  170. hour: 20,
  171. minute: 30
  172. });
  173. }
  174. },
  175. /*-------------------------------------------
  176. ## Nice select And Data Picker
  177. --------------------------------------------- */
  178. nice_select_data_picker: function () {
  179. $('.select-custom').niceSelect();
  180. if ($('#res_date').length) {
  181. $('#res_date').datetimepicker();
  182. }
  183. },
  184. /* ---------------------------------------------
  185. ## Pop Up Scripts
  186. --------------------------------------------- */
  187. popupscript: function() {
  188. //Video Popup
  189. var $videoPopup = $(".video-popup");
  190. if ( $videoPopup.length > 0 ) {
  191. $videoPopup.magnificPopup({
  192. type: "iframe",
  193. removalDelay: 300,
  194. mainClass: "mfp-fade",
  195. overflowY: "hidden",
  196. iframe: {
  197. markup: '<div class="mfp-iframe-scaler">'+
  198. '<div class="mfp-close"></div>'+
  199. '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
  200. '</div>',
  201. patterns: {
  202. youtube: {
  203. index: 'youtube.com/',
  204. id: 'v=',
  205. src: '//www.youtube.com/embed/%id%?autoplay=1'
  206. },
  207. vimeo: {
  208. index: 'vimeo.com/',
  209. id: '/',
  210. src: '//player.vimeo.com/video/%id%?autoplay=1'
  211. },
  212. gmaps: {
  213. index: '//maps.google.',
  214. src: '%id%&output=embed'
  215. }
  216. },
  217. srcAction: 'iframe_src'
  218. }
  219. });
  220. }
  221. },
  222. /* ---------------------------------------------
  223. ## Review Rating
  224. --------------------------------------------- */
  225. review_rating: function () {
  226. if ($('.review-rating').length > 0) {
  227. var options = {
  228. max_value: 5,
  229. step_size: 0.5,
  230. }
  231. $(".review-rating").rate(options);
  232. }
  233. },
  234. /* ---------------------------------------------
  235. ## Brands Carousel
  236. --------------------------------------------- */
  237. brands_carousel: function() {
  238. if ($('.brands-carousel').length) {
  239. var items = 4;
  240. $('.brands-carousel').owlCarousel({
  241. center: false,
  242. items: items,
  243. autoplay: false,
  244. autoplayTimeout: 5000,
  245. smartSpeed: 700,
  246. margin: 0,
  247. singleItem: false,
  248. loop: true,
  249. nav: false,
  250. dots: false,
  251. responsive: {
  252. 280: {
  253. items: 1
  254. },
  255. 500: {
  256. items: 2
  257. },
  258. 768: {
  259. items: 2
  260. },
  261. 992: {
  262. items: 3
  263. },
  264. 1200: {
  265. items: items
  266. }
  267. }
  268. });
  269. }
  270. },
  271. /*-------------------------------------------
  272. ## Listing Todo Single
  273. --------------------------------------------- */
  274. listing_todo_single: function() {
  275. if ($('.listing-todo-feature-list.carousel-nav-dots').length) {
  276. $('.listing-todo-feature-list.carousel-nav-dots').owlCarousel({
  277. center: false,
  278. items: 3,
  279. autoplay: true,
  280. autoplayTimeout: 3000,
  281. smartSpeed: 800,
  282. loop: true,
  283. margin: 0,
  284. singleItem : true,
  285. dots: true,
  286. nav: false,
  287. responsive: {
  288. 280: {
  289. items: 1
  290. },
  291. 768: {
  292. items: 2
  293. },
  294. 992: {
  295. items: 2
  296. },
  297. 1200: {
  298. items: 3
  299. },
  300. 1400: {
  301. items: 3
  302. }
  303. }
  304. });
  305. }
  306. if ($('.listing-todo-thumbnail-carousel').length) {
  307. $('.listing-todo-thumbnail-carousel').owlCarousel({
  308. center: false,
  309. items: 4,
  310. autoplay: false,
  311. autoplayTimeout: 3000,
  312. smartSpeed: 800,
  313. loop: true,
  314. margin: 1,
  315. singleItem : true,
  316. dots: false,
  317. nav: true,
  318. navText: ["<span class='icon-back1'></span>", "<span class='icon-next1'></span>"],
  319. responsive: {
  320. 280: {
  321. items: 1
  322. },
  323. 501: {
  324. items: 2
  325. },
  326. 768: {
  327. items: 2
  328. },
  329. 992: {
  330. items: 2
  331. },
  332. 1200: {
  333. items: 3
  334. },
  335. 1400: {
  336. items: 4
  337. }
  338. }
  339. });
  340. }
  341. if ($('.listing-gallery-slide').length) {
  342. $('.listing-gallery-slide').owlCarousel({
  343. center: false,
  344. items: 1,
  345. autoplay: false,
  346. autoplayTimeout: 5000,
  347. smartSpeed: 700,
  348. margin: 0,
  349. singleItem: true,
  350. loop: true,
  351. nav: false,
  352. dots: true,
  353. });
  354. }
  355. },
  356. /* ---------------------------------------------
  357. ## Testimonial Carousel
  358. --------------------------------------------- */
  359. testimonial_carousel: function() {
  360. var $member_items = $('.testimonial-carousel');
  361. var items = 3;
  362. if ($member_items.length) {
  363. $member_items.owlCarousel({
  364. center: false,
  365. items: items,
  366. autoplay: false,
  367. autoplayTimeout: 5000,
  368. margin: 30,
  369. singleItem: false,
  370. smartSpeed: 700,
  371. loop: true,
  372. nav: false,
  373. dots: false,
  374. responsive: {
  375. 280: {
  376. items: 1
  377. },
  378. 576: {
  379. items: 1
  380. },
  381. 768: {
  382. items: 2
  383. },
  384. 992: {
  385. items: 3
  386. },
  387. 1200: {
  388. items: items
  389. }
  390. }
  391. });
  392. }
  393. $('.testimonial-block .carousel-nav-text .btn-prev').click(function() {
  394. $member_items.trigger('prev.owl.carousel');
  395. });
  396. $('.testimonial-block .carousel-nav-text .btn-next').click(function() {
  397. $member_items.trigger('next.owl.carousel');
  398. });
  399. },
  400. /* ---------------------------------------------
  401. ## Todos Carousel
  402. --------------------------------------------- */
  403. todos_carousel: function() {
  404. var $todos_items = $('.todos-carousel');
  405. var items = 5;
  406. if ($todos_items.length) {
  407. $todos_items.owlCarousel({
  408. center: false,
  409. items: items,
  410. autoplay: false,
  411. autoplayTimeout: 5000,
  412. margin: 0,
  413. singleItem: false,
  414. smartSpeed: 700,
  415. loop: true,
  416. nav: false,
  417. dots: false,
  418. responsive: {
  419. 280: {
  420. items: 1
  421. },
  422. 576: {
  423. items: 2
  424. },
  425. 768: {
  426. items: 2
  427. },
  428. 992: {
  429. items: 3
  430. },
  431. 1200: {
  432. items: 3
  433. },
  434. 1366: {
  435. items: 4
  436. },
  437. 1670: {
  438. items: items
  439. }
  440. }
  441. });
  442. }
  443. $('.todos-block .carousel-nav-text .btn-prev').click(function() {
  444. $todos_items.trigger('prev.owl.carousel');
  445. });
  446. $('.todos-block .carousel-nav-text .btn-next').click(function() {
  447. $todos_items.trigger('next.owl.carousel');
  448. });
  449. },
  450. /* ---------------------------------------------
  451. ## Features Location Carousel
  452. --------------------------------------------- */
  453. features_location_carousel: function() {
  454. var $featuredLocationCarousel = $(".featured-location-carousel");
  455. if( $featuredLocationCarousel.length ){
  456. $featuredLocationCarousel.each(function() {
  457. var items = parseInt( $(this).attr("data-owl-items"), 10);
  458. if( !items ) items = 1;
  459. var nav = parseInt( $(this).attr("data-owl-nav"), 2);
  460. if( !nav ) nav = 0;
  461. var dots = parseInt( $(this).attr("data-owl-dots"), 2);
  462. if( !dots ) dots = 0;
  463. var center = parseInt( $(this).attr("data-owl-center"), 2);
  464. if( !center ) center = 0;
  465. var loop = parseInt( $(this).attr("data-owl-loop"), 2);
  466. if( !loop ) loop = 0;
  467. var margin = parseInt( $(this).attr("data-owl-margin"), 10);
  468. if( !margin ) margin = 0;
  469. var autoWidth = parseInt( $(this).attr("data-owl-auto-width"), 2);
  470. if( !autoWidth ) autoWidth = 0;
  471. var navContainer = $(this).attr("data-owl-nav-container");
  472. if( !navContainer ) navContainer = 0;
  473. var autoplay = parseInt( $(this).attr("data-owl-autoplay"), 2);
  474. if( !autoplay ) autoplay = 0;
  475. var autoplayTimeOut = parseInt( $(this).attr("data-owl-autoplay-timeout"), 10);
  476. if( !autoplayTimeOut ) autoplayTimeOut = 5000;
  477. var autoHeight = parseInt( $(this).attr("data-owl-auto-height"), 2);
  478. if( !autoHeight ) autoHeight = 0;
  479. var animationIn = $(this).attr("data-owl-anim-in");
  480. if( !animationIn ) animationIn = 0;
  481. else animationIn = $(this).attr("data-owl-anim-in");
  482. var animationOut = $(this).attr("data-owl-anim-out");
  483. if( !animationOut ) animationOut = 0;
  484. else animationOut = $(this).attr("data-owl-anim-out");
  485. if( $("body").hasClass("rtl") ) var rtl = true;
  486. else rtl = false;
  487. if( items === 5 ){
  488. $(this).owlCarousel({
  489. navContainer: navContainer,
  490. animateOut: animationOut,
  491. animateIn: animationIn,
  492. autoplayTimeout: autoplayTimeOut,
  493. autoplay: autoplay,
  494. autoHeight: autoHeight,
  495. center: center,
  496. loop: loop,
  497. margin: margin,
  498. autoWidth: autoWidth,
  499. items: 1,
  500. smartSpeed: 700,
  501. autoplayHoverPause: 1,
  502. nav: nav,
  503. dots: dots,
  504. rtl: rtl,
  505. navText: [],
  506. responsive: {
  507. 280: {
  508. items: 1
  509. },
  510. 576: {
  511. items: 2
  512. },
  513. 768: {
  514. items: 3
  515. },
  516. 992: {
  517. items: 3
  518. },
  519. 1200: {
  520. items: 4
  521. },
  522. 1366: {
  523. items: items
  524. }
  525. }
  526. });
  527. }
  528. else if ( items === 4 ) {
  529. $(this).owlCarousel({
  530. navContainer: navContainer,
  531. animateOut: animationOut,
  532. animateIn: animationIn,
  533. autoplayTimeout: autoplayTimeOut,
  534. autoplay: autoplay,
  535. autoHeight: autoHeight,
  536. center: center,
  537. loop: loop,
  538. margin: margin,
  539. autoWidth: autoWidth,
  540. items: 1,
  541. smartSpeed: 700,
  542. autoplayHoverPause: 1,
  543. nav: nav,
  544. dots: dots,
  545. rtl: rtl,
  546. navText: [],
  547. responsive: {
  548. 280: {
  549. items: 1
  550. },
  551. 481: {
  552. items: 2
  553. },
  554. 576: {
  555. items: 2
  556. },
  557. 768: {
  558. items: 2
  559. },
  560. 992: {
  561. items: 3
  562. },
  563. 1200: {
  564. items: items
  565. },
  566. 1366: {
  567. items: items
  568. }
  569. }
  570. });
  571. }
  572. if( $(this).find(".owl-item").length === 1 ){
  573. $(this).find(".owl-nav").css( { "opacity": 0,"pointer-events": "none"} );
  574. }
  575. });
  576. }
  577. $('.featured-locations-block .carousel-nav-text .btn-prev').click(function() {
  578. $featuredLocationCarousel.trigger('prev.owl.carousel');
  579. });
  580. $('.featured-locations-block .carousel-nav-text .btn-next').click(function() {
  581. $featuredLocationCarousel.trigger('next.owl.carousel');
  582. });
  583. },
  584. /*-------------------------------------------
  585. ## Features Cat Carousel
  586. --------------------------------------------- */
  587. features_cat_carousel: function() {
  588. if ($('.features-cat-carousel').length) {
  589. $('.features-cat-carousel').owlCarousel({
  590. center: false,
  591. items: 5,
  592. autoplay: false,
  593. autoplayTimeout: 3000,
  594. smartSpeed: 800,
  595. loop: true,
  596. margin: 10,
  597. singleItem : true,
  598. dots: false,
  599. nav: false,
  600. responsive: {
  601. 280: {
  602. items: 2
  603. },
  604. 481: {
  605. items: 3
  606. },
  607. 768: {
  608. items: 3
  609. },
  610. 992: {
  611. items: 4
  612. },
  613. 1200: {
  614. items: 5
  615. }
  616. }
  617. });
  618. }
  619. },
  620. /*-------------------------------------------
  621. ## Mega Menu Carousel
  622. --------------------------------------------- */
  623. megamenu_carousel: function() {
  624. var $megamenu_items = $('.megamenu-carousel');
  625. var items = 4;
  626. if ($megamenu_items.length) {
  627. $megamenu_items.owlCarousel({
  628. center: false,
  629. items: items,
  630. autoplay: false,
  631. autoplayTimeout: 5000,
  632. margin: 10,
  633. singleItem: false,
  634. smartSpeed: 700,
  635. loop: true,
  636. dots: false,
  637. nav: true,
  638. navText: ["<span>Prev</span>", "<span>Next</span>"],
  639. responsive: {
  640. 280: {
  641. items: 1
  642. },
  643. 1200: {
  644. items: items
  645. }
  646. }
  647. });
  648. }
  649. var $megamenu_items = $('.megamenu-carousel-two');
  650. var items = 1;
  651. if ($megamenu_items.length) {
  652. $megamenu_items.owlCarousel({
  653. center: false,
  654. items: items,
  655. autoplay: false,
  656. autoplayTimeout: 5000,
  657. margin: 10,
  658. singleItem: false,
  659. smartSpeed: 700,
  660. loop: true,
  661. dots: false,
  662. nav: true,
  663. navText: ["<span>Prev</span>", "<span>Next</span>"],
  664. responsive: {
  665. 280: {
  666. items: 1
  667. },
  668. 1200: {
  669. items: items
  670. }
  671. }
  672. });
  673. }
  674. },
  675. /* ---------------------------------------------
  676. ## Sidebar Script
  677. --------------------------------------------- */
  678. sidebarScript: function() {
  679. if ($('.sidebar-todos').length) {
  680. $('.sidebar-todos').theiaStickySidebar({
  681. 'containerSelector': '.todo-grid-list-content, .single-listing-todo-main, .user-profile-list-todo',
  682. 'additionalMarginTop': 0,
  683. 'minWidth': 992,
  684. });
  685. }
  686. },
  687. /*-------------------------------------------
  688. ## All Scroll Bar
  689. --------------------------------------------- */
  690. scroll_bar: function() {
  691. // qayima Sidebar Scroll
  692. //-------------------------------
  693. if ($('.listing-todo-main').length) {
  694. var $sidebar_scroll = $('.listing-todo-main');
  695. $sidebar_scroll.TrackpadScrollEmulator();
  696. $( window ).resize(function() {
  697. setTimeout(function() {
  698. $sidebar_scroll.TrackpadScrollEmulator('recalculate');
  699. }, 250);
  700. });
  701. }
  702. // dashboard Menu Scroll
  703. //-------------------------------
  704. if ($('.dashboard-menu-main').length) {
  705. var $sidebar_scroll = $('.dashboard-menu-main');
  706. $sidebar_scroll.TrackpadScrollEmulator();
  707. $( window ).resize(function() {
  708. setTimeout(function() {
  709. $sidebar_scroll.TrackpadScrollEmulator('recalculate');
  710. }, 250);
  711. });
  712. }
  713. },
  714. /* ---------------------------------------------
  715. ## Tags Keyword
  716. ---------------------------------------------- */
  717. tag_keyword: function() {
  718. if ($('#tag-keyword').length > 0) {
  719. var tagInput1 = new TagsInput({
  720. selector: 'tag-keyword',
  721. duplicate : false,
  722. max : 8
  723. });
  724. tagInput1.addData(['tags' , 'here'])
  725. }
  726. },
  727. /* ---------------------------------------------
  728. ## Add Listing Tab
  729. --------------------------------------------- */
  730. add_listing_tab: function() {
  731. if ($('#add-listing-area').length > 0) {
  732. var frmInfo = $('#listinfo');
  733. var frmInfoValidator = frmInfo.validate();
  734. var frmloc = $('#listlocation');
  735. var frmlocValidator = frmloc.validate();
  736. var frmCat = $('#listcat');
  737. var frmCatValidator = frmCat.validate();
  738. $('#add-listing-area').steps({
  739. onChange: function (currentIndex, newIndex, stepDirection) {
  740. // step1
  741. if (currentIndex === 0) {
  742. if (stepDirection === 'forward') {
  743. return frmInfo.valid();
  744. }
  745. if (stepDirection === 'backward') {
  746. frmInfoValidator.resetForm();
  747. }
  748. }
  749. // step3
  750. if (currentIndex === 2) {
  751. if (stepDirection === 'forward') {
  752. return frmloc.valid();
  753. }
  754. if (stepDirection === 'backward') {
  755. frmlocValidator.resetForm();
  756. }
  757. }
  758. // step4
  759. if (currentIndex === 3) {
  760. if (stepDirection === 'forward') {
  761. return frmCat.valid();
  762. }
  763. if (stepDirection === 'backward') {
  764. frmCatValidator.resetForm();
  765. }
  766. }
  767. return true;
  768. },
  769. onFinish: function () {
  770. alert('Wizard Completed');
  771. }
  772. });
  773. }
  774. },
  775. /* ---------------------------------------------
  776. ## Price Distance Range
  777. --------------------------------------------- */
  778. price_distance_range: function () {
  779. if ($('#search_distance').length > 0) {
  780. var onMove = function(e, percentage) {
  781. $(".distance-value").text((percentage).toFixed(0));
  782. }
  783. var range = new RangeSlider($("#search_distance"), {
  784. percentage: 60,
  785. onMove: onMove,
  786. onDown: onMove,
  787. pollLimit: 100
  788. });
  789. }
  790. if ($('#search_price').length > 0) {
  791. var onMove = function(e, percentage) {
  792. $(".price-value").text((percentage/0.005).toFixed(0));
  793. }
  794. var range = new RangeSlider($("#search_price"), {
  795. percentage: 30,
  796. onMove: onMove,
  797. onDown: onMove,
  798. pollLimit: 100
  799. });
  800. }
  801. },
  802. /* ---------------------------------------------
  803. ## Contact Form Script
  804. --------------------------------------------- */
  805. contactFormScript: function() {
  806. $(".hg-form-email [type='submit']").each(function(){
  807. var text = $(this).text();
  808. $(this).html("").append("<span>"+ text +"</span>").prepend("<div class='status'><i class='fas fa-circle-notch fa-spin spinner'></i></div>");
  809. });
  810. $(".hg-form-email [type='submit']").on("click", function(e){
  811. var $button = $(this);
  812. var $form = $(this).closest("form");
  813. var pathToPhp = $(this).closest("form").attr("data-php-path");
  814. $form.validate({
  815. submitHandler: function() {
  816. $button.addClass("processing");
  817. $.post( pathToPhp, $form.serialize(), function(response) {
  818. $button.addClass("done").find(".status").append(response).prop("disabled", true);
  819. });
  820. return false;
  821. }
  822. });
  823. });
  824. $("form:not(.hg-form-email)").each(function(){
  825. $(this).validate();
  826. });
  827. },
  828. /* ---------------------------------------------
  829. ## Line Chart
  830. ---------------------------------------------- */
  831. line_chart: function() {
  832. if ($('#simple-line-chart').length > 0) {
  833. new Chartist.Line('#simple-line-chart', {
  834. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  835. series: [
  836. [1, 9, 7, 8, 5, 12, 5],
  837. [2, 12, 9, 11, 7, 10, 3]
  838. ]
  839. }, {
  840. fullWidth: true,
  841. axisY: {
  842. labelInterpolationFnc: function(value) {
  843. return (value * 500);
  844. }
  845. },
  846. chartPadding: {
  847. right: 40
  848. },
  849. plugins: [
  850. Chartist.plugins.tooltip()
  851. ]
  852. });
  853. }
  854. if ($('#simple-line-chart2').length > 0) {
  855. //Simple line chart
  856. new Chartist.Line('#simple-line-chart2', {
  857. labels: false,
  858. series: [
  859. [1, 9, 7, 8, 5, 12, 15],
  860. ]
  861. }, {
  862. fullWidth: true,
  863. chartPadding: {
  864. left: -20
  865. },
  866. plugins: [
  867. Chartist.plugins.tooltip()
  868. ]
  869. });
  870. }
  871. },
  872. /* ---------------------------------------------
  873. ## Circle Progress
  874. ---------------------------------------------- */
  875. circle_progress: function() {
  876. if ($('#circle').length > 0) {
  877. $('#circle').circleProgress({
  878. value: 1,
  879. size: 130,
  880. fill: {
  881. color: ["#1d0176"]
  882. }
  883. });
  884. }
  885. if ($('#circle1').length > 0) {
  886. $('#circle1').circleProgress({
  887. value: 1,
  888. size: 130,
  889. fill: {
  890. color: ["#1d0176"]
  891. }
  892. });
  893. }
  894. },
  895. /* ---------------------------------------------
  896. function initializ
  897. --------------------------------------------- */
  898. initializ: function() {
  899. qayimaApp.scroll_top();
  900. qayimaApp.menu_script();
  901. qayimaApp.sticky_header();
  902. qayimaApp.search();
  903. qayimaApp.register_user();
  904. qayimaApp.count_down();
  905. qayimaApp.nice_select_data_picker();
  906. qayimaApp.popupscript();
  907. qayimaApp.review_rating();
  908. qayimaApp.brands_carousel();
  909. qayimaApp.listing_todo_single();
  910. qayimaApp.features_cat_carousel();
  911. qayimaApp.testimonial_carousel();
  912. qayimaApp.todos_carousel();
  913. qayimaApp.features_location_carousel();
  914. qayimaApp.megamenu_carousel();
  915. qayimaApp.sidebarScript();
  916. qayimaApp.scroll_bar();
  917. qayimaApp.tag_keyword();
  918. qayimaApp.add_listing_tab();
  919. qayimaApp.price_distance_range();
  920. qayimaApp.contactFormScript();
  921. qayimaApp.line_chart();
  922. qayimaApp.circle_progress();
  923. }
  924. };
  925. /* ---------------------------------------------
  926. Document ready function
  927. --------------------------------------------- */
  928. $(function() {
  929. qayimaApp.initializ();
  930. });
  931. })(jQuery);