* Adjust code.
This commit is contained in:
+38
-10
@@ -1,3 +1,9 @@
|
||||
/**
|
||||
* Init preference for picker.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initPreference() {
|
||||
var objPngSrc = {
|
||||
'program-browse': 'list',
|
||||
@@ -19,6 +25,15 @@ function initPreference() {
|
||||
'execution-task': 'list-recent',
|
||||
'execution-executionkanban': 'kanban',
|
||||
}
|
||||
|
||||
/**
|
||||
* Render program option.
|
||||
*
|
||||
* @param object $option
|
||||
* @param object $b
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function optionRenderProgram($option, b)
|
||||
{
|
||||
/* transform , to , then split to fit lang */
|
||||
@@ -28,19 +43,19 @@ function initPreference() {
|
||||
$option.empty();
|
||||
$option.addClass('preference');
|
||||
$option.attr("title", textArr[0]);
|
||||
/** dom to prepend
|
||||
* <div class="border>
|
||||
* <div class="preference-img"><img src="theme/default/images/guide/' + b.value + '.png"></div>
|
||||
* <div class="preference-text">
|
||||
* <div class="title"></div>
|
||||
* <div class="context"></div>
|
||||
* </div>
|
||||
* </div>
|
||||
**/
|
||||
$option.prepend('<div class="preference-border"><div class="preference-img"><img src="theme/default/images/guide/' + objPngSrc[b.value] + '.png"></div><div class="preference-text"><div class="title">' + textArr[0] + '</div><div class="context">' + textArr[1] + '</div></div></div>');
|
||||
}
|
||||
return $option;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render program text.
|
||||
*
|
||||
* @param object $option
|
||||
* @param object $b
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function textRenderProgram($text, b)
|
||||
{
|
||||
$text.empty();
|
||||
@@ -49,6 +64,14 @@ function initPreference() {
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render URSR option.
|
||||
*
|
||||
* @param object $option
|
||||
* @param object $b
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function optionRenderURSR($option, b)
|
||||
{
|
||||
if (!$option.hasClass('option-ursr'))
|
||||
@@ -65,22 +88,27 @@ function initPreference() {
|
||||
optionRender: optionRenderProgram,
|
||||
selectionTextRender: textRenderProgram
|
||||
});
|
||||
|
||||
$('.productLink').picker({
|
||||
optionRender: optionRenderProgram,
|
||||
selectionTextRender: textRenderProgram
|
||||
});
|
||||
|
||||
$('.projectLink').picker({
|
||||
optionRender: optionRenderProgram,
|
||||
selectionTextRender: textRenderProgram
|
||||
});
|
||||
|
||||
$('.executionLink').picker({
|
||||
optionRender: optionRenderProgram,
|
||||
selectionTextRender: textRenderProgram
|
||||
});
|
||||
|
||||
$('.URSR').picker({
|
||||
optionRender: optionRenderURSR
|
||||
});
|
||||
$(document).on('mousemove', 'a.picker-option', function(e)
|
||||
|
||||
$(document).on('mousemove', 'a.picker-option', function()
|
||||
{
|
||||
$('.picker-option.text-primary').removeClass('text-primary');
|
||||
$(this).addClass('text-primary');
|
||||
|
||||
Reference in New Issue
Block a user