Ignore:
Timestamp:
Mar 27, 2015 4:36:40 PM (10 years ago)
Author:
dungnv
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/www/deploy/20150304/assets/js/grid.js

    r837 r848  
    6969                                var message = '';
    7070                                if (event.ctrlKey) {
    71                                         if (!isHightLight(node))
    72                                                 hightlightNode(node);
     71                                        if (!isHighLight(node))
     72                                                highlightNode(node);
    7373                                        else
    74                                                 clearHightLightNode(node);
     74                                                clearHighLightNode(node);
    7575                                }
    7676                                else if (event.shiftKey) {
     
    7979                                        var start = aryNode.index(firstItem);
    8080                                        var finish = aryNode.index(node);
    81                                         aryNode.slice(Math.min(start, finish), Math.max(start, finish) + 1).each( function (i,o){hightlightNode(o);});
     81                                        aryNode.slice(Math.min(start, finish), Math.max(start, finish) + 1).each( function (i,o){highlightNode(o);});
    8282                                }
    8383                                else {
    84                                         clearAllHightLightNode(node);
    85                                         hightlightNode(node);                                   
     84                                        clearAllHighLightNode(node);
     85                                        highlightNode(node);                                   
    8686                                }
    8787                               
     
    101101                        }
    102102                       
    103                         var hightlightNode = function (node) {
     103                        var highlightNode = function (node) {
    104104                                $(node).addClass('selected');
    105105                        }
    106106                       
    107                         var isHightLight = function (node) {
     107                        var isHighLight = function (node) {
    108108                                return $(node).hasClass('selected');
    109109                        }
    110110                       
    111                         var clearAllHightLightNode = function () {
     111                        var clearAllHighLightNode = function () {
    112112                                $(oContainer).find('> UL > LI').removeClass('selected');
    113113                        }
    114114                       
    115                         var clearHightLightNode = function (node) {
     115                        var clearHighLightNode = function (node) {
    116116                                $(node).removeClass('selected');
    117117                        }
    118118                       
    119                         var hightLightAllNode = function () {
    120                                 clearAllHightLightNode();
     119                        var highLightAllNode = function () {
     120                                clearAllHighLightNode();
    121121                                $(oContainer).find('> UL > LI').addClass('selected');
    122122                        }
    123123                       
    124                         var getAllHightLightNode = function () {
     124                        var getAllHighLightNode = function () {
    125125                                return $(oContainer).find('> UL > LI.selected');
    126126                        }
     
    136136                                           'user-select':'none'
    137137                                     }).bind('selectstart', function(){ return false;
    138                                      }).bind('click', function(e){clearAllHightLightNode(); return false; });
     138                                     }).bind('click', function(e){clearAllHighLightNode(); return false; });
    139139
    140140                                var ul = $('<ul></ul>',{'class':'vsgrid'});
     
    239239
    240240                        this.rename = function (key) {
    241                                 var hightlightedNodes = self.getHightLightItem();
    242                                 if ($(hightlightedNodes).length == 0 || $(hightlightedNodes).length > 1) return false;
    243 
    244                                 var nodeID = $(hightlightedNodes).get(0).id;
    245                                 var nodeType = $(hightlightedNodes).get(0).type;
     241                                var highlightedNodes = self.getHighLightItem();
     242                                if ($(highlightedNodes).length == 0 || $(highlightedNodes).length > 1) return false;
     243
     244                                var nodeID = $(highlightedNodes).get(0).id;
     245                                var nodeType = $(highlightedNodes).get(0).type;
    246246
    247247                                var selectedNode = $(oContainer).find('LI#' + nodeType + nodeID + '.vscell > DIV.file-name > A#' + nodeID);
     
    256256                        }                       
    257257                       
    258                         this.getHightLightItem = function () {
     258                        this.getHighLightItem = function () {
    259259                                var nodeSelected = $(oContainer).find('LI.vscell.selected');                           
    260260                                var items = [];
     
    273273
    274274                        this.selectAllNode = function () {
    275                                 hightLightAllNode();
     275                                highLightAllNode();
    276276                        }
    277277                       
Note: See TracChangeset for help on using the changeset viewer.