Skip to content

Commit

Permalink
Fixed issue with multiple windows added version
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuS231 committed Dec 2, 2016
1 parent 2105eb2 commit 5120980
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/data/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "Property bags",
"description": "Create, Update or Delete Web Property Bags.",
"image": "/images/sp-bag-64-blue.png",
"scriptUrl": "https://cdn.rawgit.com/DariuS231/ChromeSPDevTools/9c7b1dd9e087ae22a21c3ab8d4b8c172f7af398b/dist/actions/SpPropertyBag/SpPropertyBag.js"
"scriptUrl": "https://cdn.rawgit.com/DariuS231/ChromeSPDevTools/2105eb2b5998ef3ec32b9b50bef4eb684c3c352c/dist/actions/SpPropertyBag/SpPropertyBag.js"
},
{
"title": "Site lists",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Chrome SP Dev Tools",
"version": "1.1.1",
"version": "1.1.2",
"manifest_version": 2,
"description": "Chrome SP Dev Tools",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/chromeExtension/actionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class ActionItem extends React.Component<ActionItemProps, ActionI
(document.head || document.documentElement).appendChild(script);
script.parentNode.removeChild
})('` + this.props.item.scriptUrl + `');`;
chrome.tabs.query({ active: true }, function (tab) {
chrome.tabs.query({ active: true, currentWindow: true }, function (tab) {
chrome.tabs.executeScript(tab[0].id, {
code: codeStr
}, function () {
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/chromeExtension/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import * as ReactDOM from "react-dom";
import PopUp from './popUp'


ReactDOM.render(<PopUp/>, document.getElementById('popUpContent'));;
const manifestData = chrome.runtime.getManifest();

ReactDOM.render(<PopUp currentVerion={manifestData.version}/>, document.getElementById('popUpContent'));
11 changes: 7 additions & 4 deletions src/scripts/chromeExtension/popUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface IActionData {
};

interface PopUpProps {

currentVerion: string
}
interface PopUpState {
actions: Array<IActionData>
Expand Down Expand Up @@ -45,8 +45,11 @@ export default class PopUp extends React.Component<PopUpProps, PopUpState> {
public render() {
return <div className="container">
<span className="ms-font-xxl ms-fontColor-themePrimary ms-fontWeight-semibold">Chrome SP Dev Tools</span>
<hr/>
<List items={ this.state.actions } onRenderCell={ (item, index) => (<ActionItem item={item} />) }/>
<hr />
<List items={this.state.actions} onRenderCell={(item, index) => (<ActionItem item={item} />)} />
<div className="ms-font-mi ms-fontWeight-light tool-version" >
<span>Version {this.props.currentVerion}</span>
</div>
</div>
}
}
}
3 changes: 3 additions & 0 deletions src/styles/chromeExtePopUp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,8 @@ body {
margin-bottom: 10px;
margin-top: 10px;
}
.tool-version{
float: right;
}
}
}

0 comments on commit 5120980

Please sign in to comment.