{"action":"closed","issue":{"url":"https://api.github.com/repos/igorescobar/jQuery-Mask-Plugin/issues/364","labels_url":"https://api.github.com/repos/igorescobar/jQuery-Mask-Plugin/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/igorescobar/jQuery-Mask-Plugin/issues/364/comments","events_url":"https://api.github.com/repos/igorescobar/jQuery-Mask-Plugin/issues/364/events","html_url":"https://github.com/igorescobar/jQuery-Mask-Plugin/issues/364","id":118677795,"number":364,"title":"Masks in popups","user":{"login":"estebangrd","id":7306355,"avatar_url":"https://avatars.githubusercontent.com/u/7306355?v=3","gravatar_id":"","url":"https://api.github.com/users/estebangrd","html_url":"https://github.com/estebangrd","followers_url":"https://api.github.com/users/estebangrd/followers","following_url":"https://api.github.com/users/estebangrd/following{/other_user}","gists_url":"https://api.github.com/users/estebangrd/gists{/gist_id}","starred_url":"https://api.github.com/users/estebangrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estebangrd/subscriptions","organizations_url":"https://api.github.com/users/estebangrd/orgs","repos_url":"https://api.github.com/users/estebangrd/repos","events_url":"https://api.github.com/users/estebangrd/events{/privacy}","received_events_url":"https://api.github.com/users/estebangrd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-24T18:48:50Z","updated_at":"2015-12-04T17:57:44Z","closed_at":"2015-12-04T17:57:44Z","body":"I have an input element with a specific class, (i.e. document_mask) within a popup that is created when the popup is opened and I put a mask on it the following way:\r\n\r\n$(document).ready(function () {\r\n   var options = getMaskOptions(someParams);\r\n   $('.document_mask').unmask();\r\n   $('.document_mask').mask(options['defaultMask'], options['option']);\r\n}\r\n\r\nWhen option is like:\r\noption['option'] =  {\r\n\tonKeyPress: function(val, e, field, option) {\r\n\t\tmask = someMask;\r\n\t\t\r\n\t\tfield.mask(mask, option);\r\n\t},\r\n\treverse: true\r\n};\r\noption['defaultMask'] = someDefaultMask\r\n\r\nBasically I have 2 masks to apply to one input with different document values contained within a popup, i.e. a Modify Selected Element Popup.\r\n\r\nThe first time the popup is opened, the mask is well applied but when I close it and open another popup which contains another input with a different mask applied on it, it starts switching from the mask from the input contained in the previous (closed and destroyed) popup, to the new mask applied to the new input."}}