@@ -15,7 +15,7 @@ function Datepicker(isHijr,year,month,firstDay,lang,theme,width){
15
15
if ( typeof HijriDate == 'undefined' ) throw new Error ( 'HijriDate() class required!' ) ;
16
16
const MIN_WIDTH = 280 , MAX_WIDTH = 600 ;
17
17
let dp = typeof this == 'object' ?this :window , gdate = new Date ( ) , hdate = new HijriDate ( ) , pgdate = new Date ( ) , phdate = new HijriDate ( ) , dispDate , pickDate ,
18
- tzOffset = Date . parse ( '01 Jan 1970' ) , isAttached = false , oldTheme , gridAni = 'zoom' , isRTL = false ,
18
+ tzOffset = Date . parse ( '01 Jan 1970' ) , oldTheme , gridAni = 'zoom' , isRTL = false ,
19
19
aboutElm , aboutTitleElm , aboutDateElm , aboutCloseBtnElm ,
20
20
createElm = function ( tagName , className , innerHTML ) {
21
21
let el = document . createElement ( tagName ) ; if ( className ) el . className = className ; if ( innerHTML ) el . innerHTML = innerHTML ; return el
@@ -173,7 +173,7 @@ function Datepicker(isHijr,year,month,firstDay,lang,theme,width){
173
173
if ( el ) el . className = el . className . replace ( 'w3-' + oldTheme , 'w3-' + theme )
174
174
}
175
175
} ;
176
- dp . attachTo = function ( el ) { if ( el . appendChild && ! isAttached ) { el . appendChild ( dpickElm ) ; isAttached = true ; return true } return false } ;
176
+ dp . attachTo = function ( el ) { if ( el . appendChild && ! dpickElm . parentNode ) { el . appendChild ( dpickElm ) ; return true } return false } ;
177
177
dp . getElement = function ( ) { return dpickElm } ;
178
178
dp . getOppositePickedDate = function ( ) { return getOppsPDate ( ) } ;
179
179
dp . getPickedDate = function ( ) { return pickDate } ;
0 commit comments