diff --git a/mock/LightDMMock.js b/mock/LightDMMock.js index 96159a6..e2abc7b 100644 --- a/mock/LightDMMock.js +++ b/mock/LightDMMock.js @@ -11,7 +11,10 @@ * Include the file in your theme that needs mocking * * Create a new instance of LightDMMock - * var lightdm = lightdm || new LightDMMock(autofill, timeout, autoGuest); + * if(!("lightdm" in window)) { + * var LightDMMock = LightDMMock || {}; + * window.lightdm = new LightDMMock(autofill, timeout, autoGuest); + * } * * @param {boolean} autofill [wether or not the arrays for users, languages, * layouts, and sessions need to be filled with mock diff --git a/readme.md b/readme.md index 884801b..7735a77 100644 --- a/readme.md +++ b/readme.md @@ -12,7 +12,10 @@ git clone git@github.com:CytoDev/LightDMMock.git ```` 3. Create a new instance of LightDMMock ````javascript -var lightdm = lightdm || new LightDMMock(autofill, timeout, autoGuest); +if(!("lightdm" in window)) { + var LightDMMock = LightDMMock || {}; + window.lightdm = new LightDMMock(autofill, timeout, autoGuest); +} ```` ##Parameters of LightDMMock()