[ADD]Added file recruitment.js
authorbth-openerp <bth@tinyerp.com>
Wed, 21 Aug 2013 06:49:37 +0000 (12:19 +0530)
committerbth-openerp <bth@tinyerp.com>
Wed, 21 Aug 2013 06:49:37 +0000 (12:19 +0530)
bzr revid: bth@tinyerp.com-20130821064937-60f9997w8t6yo0yl

addons/website_hr_recruitment/static/src/js/recruitment.js [new file with mode: 0644]

diff --git a/addons/website_hr_recruitment/static/src/js/recruitment.js b/addons/website_hr_recruitment/static/src/js/recruitment.js
new file mode 100644 (file)
index 0000000..4b6eeb7
--- /dev/null
@@ -0,0 +1,18 @@
+$(function () {
+    $(document).on('click', '.js_published, .js_unpublished', function (e) {
+        e.preventDefault();
+        var $link = $(this).parent();
+        $link.find('.js_published, .js_unpublished').addClass("hidden");
+        var $unp = $link.find(".js_unpublished");
+        var $p = $link.find(".js_published");
+        $.post('/recruitment/published', {'id': $link.data('id'), 'object': $link.data('object')}, function (result) {
+            if (+result) {
+                $p.addClass("hidden");
+                $unp.removeClass("hidden");
+            } else {
+                $p.removeClass("hidden");
+                $unp.addClass("hidden");
+            }
+        });
+    });
+});