Skip to content

Commit

Permalink
Add code example
Browse files Browse the repository at this point in the history
  • Loading branch information
themitosan authored Sep 27, 2023
1 parent 1bf89ae commit b7dbbc0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ Example: ```TMS.removeClass('myDiv', 'fixWidth');```

**INFO**: You can also _provide other contexts_ for all available functions. This allows you to manipulate data from another opened windows (like `nw.js` Window.open function).

Example:
```ts
// Import module and create context variable
import * as TMS from './TMS';
var context;

// Open window
nw.Window.open('project/somePage.html', {}, function(data:any){
context = data.window.document;
});

// Set div CSS data from new opened window by providing context
TMS.css('someDivInsideNewWindow', { 'width': '100%', height: '20px' }, context);
```

## External scripts / plugins used on this project:
- [uglify-js](https://www.npmjs.com/package/uglify-js)

Expand Down

0 comments on commit b7dbbc0

Please sign in to comment.