Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
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
edx
edx-platform
Commits
1a179289
Commit
1a179289
authored
Aug 15, 2016
by
Asad Iqbal
Committed by
GitHub
Aug 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13220 from edx/asadiqbal08/OLIVE-75
OLIVE-75 - CourseID Term not rendering correctly.
parents
fa136937
1e938162
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
+42
-3
cms/static/js/index.js
+24
-3
cms/static/js/spec/views/pages/index_spec.js
+10
-0
cms/static/sass/views/_dashboard.scss
+8
-0
No files found.
cms/static/js/index.js
View file @
1a179289
...
@@ -67,6 +67,23 @@ define(['domReady', 'jquery', 'underscore', 'js/utils/cancel_on_escape', 'js/vie
...
@@ -67,6 +67,23 @@ define(['domReady', 'jquery', 'underscore', 'js/utils/cancel_on_escape', 'js/vie
});
});
};
};
var
rtlTextDirection
=
function
()
{
var
Selectors
=
{
new_course_run
:
'#new-course-run'
};
if
(
$
(
'body'
).
hasClass
(
'rtl'
))
{
$
(
Selectors
.
new_course_run
).
addClass
(
'course-run-text-direction placeholder-text-direction'
);
$
(
Selectors
.
new_course_run
).
on
(
'input'
,
function
()
{
if
(
this
.
value
===
''
)
{
$
(
Selectors
.
new_course_run
).
addClass
(
'placeholder-text-direction'
);
}
else
{
$
(
Selectors
.
new_course_run
).
removeClass
(
'placeholder-text-direction'
);
}
});
}
};
var
makeCancelHandler
=
function
(
addType
)
{
var
makeCancelHandler
=
function
(
addType
)
{
return
function
(
e
)
{
return
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -81,18 +98,22 @@ define(['domReady', 'jquery', 'underscore', 'js/utils/cancel_on_escape', 'js/vie
...
@@ -81,18 +98,22 @@ define(['domReady', 'jquery', 'underscore', 'js/utils/cancel_on_escape', 'js/vie
};
};
var
addNewCourse
=
function
(
e
)
{
var
addNewCourse
=
function
(
e
)
{
var
$newCourse
,
$cancelButton
,
$courseName
;
e
.
preventDefault
();
e
.
preventDefault
();
$
(
'.new-course-button'
).
addClass
(
'is-disabled'
).
attr
(
'aria-disabled'
,
true
);
$
(
'.new-course-button'
).
addClass
(
'is-disabled'
).
attr
(
'aria-disabled'
,
true
);
$
(
'.new-course-save'
).
addClass
(
'is-disabled'
).
attr
(
'aria-disabled'
,
true
);
$
(
'.new-course-save'
).
addClass
(
'is-disabled'
).
attr
(
'aria-disabled'
,
true
);
var
$newCourse
=
$
(
'.wrapper-create-course'
).
addClass
(
'is-shown'
);
$newCourse
=
$
(
'.wrapper-create-course'
).
addClass
(
'is-shown'
);
var
$cancelButton
=
$newCourse
.
find
(
'.new-course-cancel'
);
$cancelButton
=
$newCourse
.
find
(
'.new-course-cancel'
);
var
$courseName
=
$
(
'.new-course-name'
);
$courseName
=
$
(
'.new-course-name'
);
$courseName
.
focus
().
select
();
$courseName
.
focus
().
select
();
$
(
'.new-course-save'
).
on
(
'click'
,
saveNewCourse
);
$
(
'.new-course-save'
).
on
(
'click'
,
saveNewCourse
);
$cancelButton
.
bind
(
'click'
,
makeCancelHandler
(
'course'
));
$cancelButton
.
bind
(
'click'
,
makeCancelHandler
(
'course'
));
CancelOnEscape
(
$cancelButton
);
CancelOnEscape
(
$cancelButton
);
CreateCourseUtils
.
setupOrgAutocomplete
();
CreateCourseUtils
.
setupOrgAutocomplete
();
CreateCourseUtils
.
configureHandlers
();
CreateCourseUtils
.
configureHandlers
();
rtlTextDirection
();
};
};
var
saveNewLibrary
=
function
(
e
)
{
var
saveNewLibrary
=
function
(
e
)
{
...
...
cms/static/js/spec/views/pages/index_spec.js
View file @
1a179289
...
@@ -60,6 +60,16 @@ define(['jquery',
...
@@ -60,6 +60,16 @@ define(['jquery',
$
(
'.new-course-org'
).
autocomplete
(
'destroy'
);
$
(
'.new-course-org'
).
autocomplete
(
'destroy'
);
});
});
it
(
'set the correct direction of text in case of rtl'
,
function
()
{
$
(
'body'
).
addClass
(
'rtl'
);
$
(
'.new-course-button'
).
click
();
$
(
'.new-course-run'
).
val
(
'2014_T2'
).
trigger
(
'input'
);
expect
(
$
(
'.new-course-run'
).
hasClass
(
'placeholder-text-direction'
)).
toBe
(
false
);
$
(
'.new-course-run'
).
val
(
''
).
trigger
(
'input'
);
expect
(
$
(
'.new-course-run'
).
hasClass
(
'placeholder-text-direction'
)).
toBe
(
true
);
});
it
(
'displays an error when saving fails'
,
function
()
{
it
(
'displays an error when saving fails'
,
function
()
{
var
requests
=
AjaxHelpers
.
requests
(
this
);
var
requests
=
AjaxHelpers
.
requests
(
this
);
$
(
'.new-course-button'
).
click
();
$
(
'.new-course-button'
).
click
();
...
...
cms/static/sass/views/_dashboard.scss
View file @
1a179289
...
@@ -677,6 +677,14 @@
...
@@ -677,6 +677,14 @@
.new-course-run
{
.new-course-run
{
width
:
100%
;
width
:
100%
;
}
}
.course-run-text-direction
{
direction
:
ltr
;
text-align
:
right
;
}
.placeholder-text-direction
{
direction
:
rtl
;
}
.new-course-name
{
.new-course-name
{
@extend
%t-title5
;
@extend
%t-title5
;
...
...
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