From 17e09b64af92f01659a858ff20e68b08c1f4cb80 Mon Sep 17 00:00:00 2001 From: james Date: Sun, 18 Dec 2011 22:55:03 -0500 Subject: [PATCH] CC-3210 Show: Date mask does not work when you "Add This Show" -> "Close" -> "+ Show" - moved masking function to more appropriate place which also fixed the bug --- .../public/js/airtime/schedule/add-show.js | 21 ++----------------- .../schedule/full-calendar-functions.js | 7 +++++++ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index 08e09305a..7ff725335 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -444,12 +444,7 @@ function showErrorSections() { } $(document).ready(function() { - $.mask.masks = $.extend($.mask.masks,{ - date:{ mask: '9999-19-39', selectCharsOnFocus: true, autoTab: false}, - time:{ mask: '29:69', selectCharsOnFocus: true, autoTab: false} - }) - - $('input:text').setMask() + setAddShowEvents(); }); //Alert the error and reload the page @@ -475,16 +470,4 @@ $(window).resize(function(){ $('#schedule_calendar').fullCalendar('option', 'contentHeight', mainHeight) $("#schedule_calendar").fullCalendar('render'); -}); - -$(window).load(function() { - $.mask.masks = $.extend($.mask.masks,{ - date:{ mask: '9999-19-39', selectCharsOnFocus: true, autoTab: false}, - time:{ mask: '29:69', selectCharsOnFocus: true, autoTab: false} - }) - - $('input:text').setMask() - - setAddShowEvents(); - -}); +}); \ No newline at end of file diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index a7640eb5e..1bd193bde 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -37,6 +37,13 @@ function openAddShowForm() { $add_show_name.select(); }); } + + $.mask.masks = $.extend($.mask.masks,{ + date:{ mask: '9999-19-39', selectCharsOnFocus: true, autoTab: false}, + time:{ mask: '29:69', selectCharsOnFocus: true, autoTab: false} + }) + + $('input:text').setMask() } function makeAddShowButton(){