Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
430f862b
Commit
430f862b
authored
Mar 01, 2014
by
Thiago Talma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Arrows to display the previous and next files.
parent
b9743ef6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
gii.js
extensions/gii/assets/gii.js
+14
-2
files.php
extensions/gii/views/default/view/files.php
+8
-1
No files found.
extensions/gii/assets/gii.js
View file @
430f862b
...
...
@@ -35,10 +35,13 @@ yii.gii = (function ($) {
};
var
initPreviewDiffLinks
=
function
()
{
$
(
'.preview-code, .diff-code, .modal-refresh'
).
on
(
'click'
,
function
()
{
$
(
'.preview-code, .diff-code, .modal-refresh
, .modal-previous, .modal-next
'
).
on
(
'click'
,
function
()
{
var
$modal
=
$
(
'#preview-modal'
);
var
$link
=
$
(
this
);
$modal
.
find
(
'.modal-refresh'
).
attr
(
'href'
,
$link
.
prop
(
'href'
));
$modal
.
find
(
'.modal-refresh'
).
attr
(
'href'
,
$link
.
attr
(
'href'
));
if
(
$link
.
hasClass
(
'preview-code'
)
||
$link
.
hasClass
(
'diff-code'
))
{
$modal
.
data
(
'action'
,
(
$link
.
hasClass
(
'preview-code'
)
?
'preview-code'
:
'diff-code'
))
}
$modal
.
find
(
'.modal-title'
).
text
(
$link
.
data
(
'title'
));
$modal
.
find
(
'.modal-body'
).
html
(
'Loading ...'
);
$modal
.
modal
(
'show'
);
...
...
@@ -48,6 +51,15 @@ yii.gii = (function ($) {
url
:
$link
.
prop
(
'href'
),
data
:
$
(
'.default-view form'
).
serializeArray
(),
success
:
function
(
data
)
{
if
(
!
$link
.
hasClass
(
'modal-refresh'
))
{
var
filesSelector
=
'a.'
+
$modal
.
data
(
'action'
);
var
$files
=
$
(
filesSelector
);
var
index
=
$files
.
filter
(
'[href="'
+
$link
.
attr
(
'href'
)
+
'"]'
).
index
(
filesSelector
);
var
$prev
=
$files
.
eq
(
index
-
1
);
var
$next
=
$files
.
eq
((
index
+
1
==
$files
.
length
?
0
:
index
+
1
));
$modal
.
find
(
'.modal-previous'
).
attr
(
'href'
,
$prev
.
attr
(
'href'
)).
data
(
'title'
,
$prev
.
data
(
'title'
));
$modal
.
find
(
'.modal-next'
).
attr
(
'href'
,
$next
.
attr
(
'href'
)).
data
(
'title'
,
$next
.
data
(
'title'
));
}
$modal
.
find
(
'.modal-body'
).
html
(
data
);
$modal
.
find
(
'.content'
).
css
(
'max-height'
,
(
$
(
window
).
height
()
-
200
)
+
'px'
);
},
...
...
extensions/gii/views/default/view/files.php
View file @
430f862b
...
...
@@ -81,7 +81,14 @@ use yii\gii\CodeFile;
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4><a
class=
"modal-refresh glyphicon glyphicon-refresh"
href=
"#"
></a>
<span
class=
"modal-title"
>
Modal title
</span></h4>
<div
class=
"btn-group pull-left"
>
<a
class=
"modal-previous btn btn-xs btn-default"
href=
"#"
><span
class=
"glyphicon glyphicon-arrow-left"
></span></a>
<a
class=
"modal-next btn btn-xs btn-default"
href=
"#"
><span
class=
"glyphicon glyphicon-arrow-right"
></span></a>
<a
class=
"modal-refresh btn btn-xs btn-default"
href=
"#"
><span
class=
"glyphicon glyphicon-refresh"
></span></a>
</div>
<strong
class=
"modal-title pull-left"
>
Modal title
</strong>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"modal-body"
>
<p>
Please wait ...
</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment