From 575c131a16d2f29956fef1aff7d878f3d0645a83 Mon Sep 17 00:00:00 2001 From: prashant Date: Tue, 30 Jun 2015 11:09:24 +0530 Subject: Initial commit --- js/main.js | 28 ++++++++++++++++++++++++++++ js/smooth_scroll.js | 26 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100755 js/main.js create mode 100755 js/smooth_scroll.js (limited to 'js') diff --git a/js/main.js b/js/main.js new file mode 100755 index 0000000..47e8925 --- /dev/null +++ b/js/main.js @@ -0,0 +1,28 @@ +$(document).ready(function() { + var basePath = Drupal.settings.basePath; + var modPath = basePath + "jobs/"; + + $shortlist = $(".shortlist"); + $shortlist.click(function (e) { + $(".sync-msg").remove(); + $(this).after("Saving..."); + $.ajax({ + url: modPath + "ajax/shortlist/" + $(this).data("aid"), + success: function() { + $(".sync-msg").remove(); + console.log("success"); + } + }); + }); + + + $(this).on('click','#d_app',function (e){ + if($shortlist.prop("checked") == false){ + alert("Please select atleast one resume for download"); + e.preventDefault(); + } + console.log('####'); + + }); + +}); diff --git a/js/smooth_scroll.js b/js/smooth_scroll.js new file mode 100755 index 0000000..d16dc1a --- /dev/null +++ b/js/smooth_scroll.js @@ -0,0 +1,26 @@ +(function($) { + $(document).ready(function() { + $('a[href*=#]:not([href=#])').click(function() { + if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') + || location.hostname == this.hostname) { + + var target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); + if (target.length) { + $('html,body').animate({ + scrollTop: target.offset().top + }, 1000); + return false; + } + } + }); + $(".quick").click(function() { + $(".quick").removeClass("badge-success"); + $(this).addClass("badge-success"); + setTimeout(function() { + $(".quick").removeClass("badge-success"); + }, 4000); + }); + $('.quick').tooltip(); + }); +})(jQuery); -- cgit