Comments (9)
It is okay to have a pull request in the current state.
Submitted PR.
I'll take care of the rest.
Thank you so much!!
from redmine-view-customize.
Released at v2.8.0.
Thanks!
from redmine-view-customize.
Thank you for your feature request.
What you want to do may be possible without additional features.
With the window
load event, you'd be able to run it after the Gantt chart script.
$(window).on('load', function() {
// your scripts
});
This is because the window
load event occurs after $(function{})
.
Would you please give it a try?
If you can't get around it here, we'd like to add a feature.
from redmine-view-customize.
Thanks!
I've tried it, but no success.
Actually, it worked with RedMica v1.1, but not works with RedMica v1.2.
I will try again and paste the script here later.
Anyway, I am trying to implement it...
https://github.com/iquiw/redmine-view-customize/tree/body-bottom
from redmine-view-customize.
Thanks for trying.
If the load event doesn't work, it may not work even if you use View customize to handle it.
from redmine-view-customize.
Here is the script, which saves and restores Gantt chart subject column width.
// https://stackoverflow.com/a/2523758
$.widget("ui.resizable", $.ui.resizable, {
resizeTo: function(newSize) {
let start = new $.Event("mousedown", { pageX: 0, pageY: 0 });
this._mouseStart(start);
this.axis = 'se';
let end = new $.Event("mouseup", {
pageX: newSize.width - this.originalSize.width,
pageY: newSize.height - this.originalSize.height
});
this._mouseDrag(end);
this._mouseStop(end);
}
});
$(window).on('load', function() {
//$(function() {
const GANTT_SUBJECT_WIDTH_KEY = 'redmine-gantt-subject-width';
let $subject = $('.gantt_subjects_column.ui-resizable');
$subject.resizable({
stop: function(event, ui) {
localStorage.setItem(GANTT_SUBJECT_WIDTH_KEY, ui.size.width);
}
});
let width = localStorage.getItem(GANTT_SUBJECT_WIDTH_KEY);
if (width) {
$subject.resizable('resizeTo', { width: width, height: $subject.height() });
}
});
As far as I tried the following combinations with RedMica v1.2,
- Browser: Chrome/Firefox
- Position:
Head of all pages
/Bottom of all pages
- Load:
$(window).on('load'
/$(function()
With Chrome, it works in the following cases.
Head of all pages |
Bottom of all pages |
|
---|---|---|
$(window).on('load' |
O | O |
$(function() |
X | O |
With Firefox, it works only when using $(function()
and Bottom of all pages
.
Head of all pages |
Bottom of all pages |
|
---|---|---|
$(window).on('load' |
X (*1) | X |
$(function() |
X | O |
(*1) worked with RedMica v1.1.
from redmine-view-customize.
Thank you for the information.
I don't understand why the window load doesn't work well in Firefox.
Is there some kind of error?
Either way, we are thinking of including this feature.
from redmine-view-customize.
I don't understand why the window load doesn't work well in Firefox.
It could be a bug of Firefox though I am not sure.
Is there some kind of error?
No error, $('.gantt_subjects_column.ui-resizable').length
is 0 in the case.
Either way, we are thinking of including this feature.
Thanks!
I will try to add unit test and update README.
I am afraid I cannot update Chinese translation.
from redmine-view-customize.
Either way, we are thinking of including this feature.
Thanks!
I will try to add unit test and update README.
I am afraid I cannot update Chinese translation.
It is okay to have a pull request in the current state.
I'll take care of the rest.
Thanks.
from redmine-view-customize.
Related Issues (20)
- Unable to install the plugin HOT 3
- ViewCustomize User Roles on project HOT 1
- NoMethodError: undefined method `represent_boolean_as_integer=' for nil:NilClass encountered with Redmine 4.1.0-9 HOT 2
- Customized Key/value list Value HOT 3
- Add user mails to ViewCustomize context HOT 3
- Version incorrect in init.rb HOT 1
- unable install the plugins for view customize in ubuntu HOT 7
- Add total estimated hours and total spent hours for the issue to ViewCustomize.context.
- Error when install plugin! HOT 51
- context leaks data user has no access to HOT 3
- Trouble in installation HOT 2
- Not working at Redmine 4.1.1 (Bitnami) with undeinfed method before_filter error HOT 4
- Thx, this is great! HOT 4
- Strange characters in the path pattern and comments. HOT 2
- User and password HOT 5
- Allow to specify who can view customization by user name and role HOT 5
- LoadError during startup with Redmine trunk r21288 HOT 2
- Add ViewCustomize.context.project.id HOT 1
- Question regards View Customize and Custom Table Plugins HOT 2
- Add the issue's author and last updated by to ViewCustomize.context
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redmine-view-customize.