Skip to content

Commit

Permalink
fix dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasan Özbey committed Jul 16, 2021
1 parent 47a4b25 commit f75cec4
Show file tree
Hide file tree
Showing 7 changed files with 1,219 additions and 884 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.1.1
- **Fix** diff dropdown was closing after clicking on a deleted revision on pages those created by other extensions.

### 1.1.0
- **Fix** tooltips won't disappear on Firefox. (issue #27)
- **Fix** empty alert message appears after rollbacking to / deleting revision. (issue #28)
Expand Down
8 changes: 0 additions & 8 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
* LICENSE: For the full copyright and license information,
* please view the LICENSE file that was distributed
* with this source code.
*
* @author Hasan Özbey <[email protected]>
* @copyright 2020
* @license The MIT License
*
* @version Release: 1.1.0
*
* @link https://github.com/the-turk/flarum-diff
*/

namespace TheTurk\Diff;
Expand Down
2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

2,058 changes: 1,201 additions & 857 deletions js/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "@the-turk/flarum-diff",
"description": "View post edit histories.",
"license": "MIT",
"version": "1.1.0",
"dependencies": {
"flarum-webpack-config": "0.1.0-beta.16.2",
"webpack": "^4.46.0",
"webpack-cli": "^4.7.0"
"webpack-cli": "^3.3.12"
},
"devDependencies": {
"flarum-webpack-config": "1.0.0",
"flarum-tsconfig": "^1.0.0",
"prettier": "^2.3.1"
},
"repository": {
Expand Down
24 changes: 10 additions & 14 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import app from 'flarum/common/app';
import { extend } from 'flarum/common/extend';
import CommentPost from 'flarum/forum/components/CommentPost';
import Diff from './models/Diff';

import app from 'flarum/common/app';
import CommentPost from 'flarum/common/components/CommentPost';
import Page from 'flarum/common/components/Page';
import Post from 'flarum/common/models/Post';
import Model from 'flarum/common/Model';

import Diff from './models/Diff';
import DiffDropdown from './components/DiffDropdown';
import DiscussionPage from 'flarum/forum/components/DiscussionPage';


app.initializers.add('the-turk-diff', () => {
app.store.models.diff = Diff;
Expand All @@ -28,16 +31,9 @@ app.initializers.add('the-turk-diff', () => {
}
});

// prevent dropdown from closing when user
// clicks on deleted diff
extend(DiscussionPage.prototype, 'oninit', function () {
const $body = $('body');

$body.on('click', 'li.ParentDiff.DeletedDiff', function (e) {
e.stopPropagation();
});

$body.on('click', 'li.SubDiff', function (e) {
// prevent dropdown from closing when user clicks on deleted diff
extend(Page.prototype, 'oninit', function () {
$('body').on('click', 'li.ParentDiff.DeletedDiff, li.SubDiff', function (e) {
e.stopPropagation();
});
});
Expand Down

0 comments on commit f75cec4

Please sign in to comment.